Create an RFI
This tutorial demonstrates how to create an RFI item for a Forma project. The steps include verifying the user’s permissions, retrieving the RFI type ID, retrieving the next custom identifier (optional), identifying the assignee’s ID, and creating the RFI.
Before You Begin
- Register an app
- Acquire a 3-legged OAuth token with
data:writeaccount:readscopes. - Verify that you have access to the relevant hub and Forma project.
- Find the relevant project ID for the project you want to create an RFI in by following the Retrieve a Hub ID and Project ID tutorial. In this example, assume the hub ID is
g5s4e3b5-vbta-6b02-d23a-5d55f36ba876, and the project ID isce8edd30-ef28-467c-8d99-7d7051097ee0.
Step 1: Verify the User’s Permissions
To check if the user has permission to create RFIs, call GET users/me.
If the permittedActions.createRfi object appears in the response, the user has permission to create RFIs. This object includes a list of allowed initial statuses (permittedStatuses), each with its own required and optional attributes. It also specifies which users the RFI can be assigned to.
For example, to create an RFI with status submitted, you must include all fields listed under requiredAttributes for that status (such as title and assignedTo), and choose an assignedTo value from the permitted list.
If permittedActions.createRfi is not present, the user does not have permission to create RFIs in the project.
Request
Response
From the response above, you can extract the required information to build your RFI request:
-
The user ID is
KMQ7KREACSE7. -
Under workflow
wfUS, the user can create an RFI in thedraft,submitted, oropenstatus. -
To create a
draftRFI:- The required attribute is
title. - The permitted
assignedTovalue isKMQ7KREACSE7.
- The required attribute is
-
To create a
submittedRFI:- Required attributes:
titleandassignedTo. - Permitted
assignedTovalues:2UDYLKMEVARC,336SNF7WG2KU,V3KTJ2YVRF29.
- Required attributes:
In the next step, you’ll use these values to build the request body. Make sure the status and required fields you send match what’s allowed for your workflow, or the request will be rejected.
Step 2: Find the RFI Type ID
To create an RFI, you must include the RFI type ID (rfiTypeId) in the request body.
To retrieve a list of available RFI types for the project, call GET rfi-types using the project ID (ce8edd30-ef28-467c-8d99-7d7051097ee0).
Request
Response
Find the RFI type (rfiType) - results[rfiTypes.[name]] (My_rfi_type), and note the type ID (rfiType ID) - results[rfiTypes.[id]] (294f293c-aad0-43db-ba2b-c7eed815bbb7).
Step 3: (Optional) Find Next Custom Identifier
If your project uses custom identifiers for RFIs, you can retrieve the next available value by calling GET custom-identifier.
Use the project ID (ce8edd30-ef28-467c-8d99-7d7051097ee0) in the request.
Request
Response
Use the next value (e.g., G30ww16r8) as the customIdentifier when creating the RFI.
Step 4: (Optional) Find Custom Attribute Definitions
If your project uses custom attributes, you must first retrieve their definitions before assigning values. Call GET attributes using the project ID (ce8edd30-ef28-467c-8d99-7d7051097ee0).
Request
Response
Search for the custom attribute mapping IDs and check the data in the corresponding object. For this tutorial, we will use the custom attribute ID (09b37029-bf1b-47b6-b9f1-c56735b2fc52) and the custom attribute value (1252).
Step 5: (Optional) Find the ID of the Assignee
To find the ID of the assignee, use the GET projects/users from the Admin API.
Step 6: Create the RFI
Call POST rfis using the project ID (ce8edd30-ef28-467c-8d99-7d7051097ee0), the RFI type (rfiTypeId) ID (294f293c-aad0-43db-ba2b-c7eed815bbb7), and the custom identifier (G30ww16r8) the custom attribute ID (09b37029-bf1b-47b6-b9f1-c56735b2fc52) and the custom attribute value (1252).
Request
Response
Note that virtual folder creation is triggered as a separate asynchronous job when an RFI is created. Until this folder is successfully created, users cannot upload files into it. To confirm that the folder is ready, call GET rfis/:id </en/docs/acc/v1/reference/http/rfis-rfis-id-GET/> and check that the virtualFolderUrn field appears in the response.
Congratulations! You have created a Forma RFI.
Imported from the Autodesk Platform Services documentation: https://aps.autodesk.com/en/docs/acc/v1/tutorials/rfis3/rfi-create.