POST /api/checklists - Detailed Guidance

POST /api/checklists - Detailed Guidance

Anonymous
Not applicable
629 Views
2 Replies
Message 1 of 3

POST /api/checklists - Detailed Guidance

Anonymous
Not applicable

Hi,

 

I'm trying to upload a new checklist via the API for 360 Field. I have a template checklist setup in a project, see below:

 

{
        "template_id": "2347c055-66a7-4119-b831-d3f222a92e95",
        "name": "API Checklist Type 2",
        "description": null,
        "tags": null,
        "auto_create_issue": false,
        "company_id": null,
        "priority": null,
        "updated_at": "2019-02-12 12:46:29 +0000",
        "checklist_type": "QA/QC",
        "header": "",
        "footer": "",
        "issue_type_id": "d713cd28-8b3f-4468-811e-4c6494f14273",
        "custom_field_values": [],
        "template_items": [
            {
                "template_item_id": "990d1376-4892-45a3-ae14-bd0c8bdffa67",
                "number": "",
                "position": 1,
                "item_text": "Automatically Populated?",
                "more_info": "",
                "is_section": false,
                "template_id": "2347c055-66a7-4119-b831-d3f222a92e95",
                "company_id": null,
                "response_type_id": "24e6efab-0f52-446f-9cc5-db49caaa1ce3",
                "default_answer": "",
                "spec_ref": "",
                "attachments": [],
                "document_references": [],
                "document_folder_references": [],
                "uri_references": [],
                "root_cause_id": null,
                "issue_description": "",
                "response_type": {
                    "response_type_id": "24e6efab-0f52-446f-9cc5-db49caaa1ce3",
                    "display_type": "drop-down",
                    "name": "True, False, N/A",
                    "required": false,
                    "position": 782,
                    "possible_values": [
                        "True",
                        "False",
                        "N/A"
                    ]
                }
            }
        ]
    }

I'm using the POST /api/checklists endpoint to try and upload a new checklist. I'm sending the following data as a string in a checklists parameter:

 

[ 
   {
      "tags":"",
      "template_id":"2347c055-66a7-4119-b831-d3f222a92e95",
      "status":"Open",
      "identifier":null,
      "name":"API Checklist - Febru",
      "checklist_type":"QA/QC",
      "description":"",
      "area_id":null,
      "source_id":null,
      "source_type":null,
      "company_id":null,
      "checklist_items":[ 
         { 
            "template_item_id":"990d1376-4892-45a3-ae14-bd0c8bdffa67",
            "comment":"",
            "position":1,
            "spec_ref":"",
            "response":"True",
            "location_detail":null,
            "company_id":null,
            "area_id":null
         }
      ]
   }
]

When I run this I get a code 500 server error and nothing other meaningful error message. If I check the Field 360 website I note that a checklist has been created; of sorts - it only includes the header data, no other fields are included:

 

 

Screenshot 2019-02-12 at 13.38.53.png

What needs to be sent to ensure that fields are populated when creating a checklist using the API?

 

If I reduce the fields to a bare minimum, I still get the same result, a 500 error.

 

ANY help would be greatly appreciated!

0 Likes
630 Views
2 Replies
Replies (2)
Message 2 of 3

eason.kangEDLV4
Autodesk Support
Autodesk Support

Hi,

 

I'm checking with our engineering team, and will get you back A.S.A.P.

 

Cheers,

 

 


Eason Kang
Developer Advocate
Developer Advocacy & Support Service
Autodesk Platform Service (formerly Forge)

0 Likes
Message 3 of 3

eason.kangEDLV4
Autodesk Support
Autodesk Support

Hi,

 

Apologizing for the delay, it takes me some time to discuss this with our engineering team. To create a checklist via API, you have to pass all fields below and the response_type_id as well as the id attribute. 

 

 

curl -X POST \
  https://bim360field.autodesk.com/api/checklists \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "project_id": "{PROJ_ID}",
  "ticket": "{YOUR_FIELD_TICKET}",
  "application_version": "4.0",
  "checklists": "[{\"id\":\"{RANDOM_GUID}\",\"template_id\":\"2347c055-66a7-4119-b831-d3f222a92e95\",\"identifier\":\"\",\"name\":\"API Checklist - Febru\",\"responsible_company_id\":\"\",\"status\":\"Open\",\"checklist_type\":\"QA/QC\",\"priority\":\"Medium\",\"tags\":\"\",\"project_id\":\"{PROJ_ID}\",\"created_by\":\"{USER_EMAIL}\",\"created_at\":\"\",\"updated_at\":\"\",\"description\":\"\",\"deleted_at\":\"\",\"area_id\":\"\",\"source_id\":\"\",\"source_type\":\"\",\"uploaded_at\":\"\",\"checklist_items\":[{\"is_section\":false,\"location_detail\":null,\"company_id\":null,\"response\":\"True\",\"spec_ref\":\"\",\"updated_at\":\"\",\"response_type_id\":\"24e6efab-0f52-446f-9cc5-db49caaa1ce3\",\"more_info\":\"\",\"area_id\":null,\"checklist_id\":\"{THE_SAME_RANDOM_GUID_ABOVE}\",\"comment\":null,\"touched\":true,\"position\":1,\"uploaded_at\":null,\"template_item_id\":\"990d1376-4892-45a3-ae14-bd0c8bdffa67\"}]}]"
}'

Note.

 

  • You have to generate a unique GUID (i.e. RANDOM_GUID) for each uploading checklist record
  • The checklists attribute is a quoted JSON as shown above.

Hope it helps.

 

Cheers,


Eason Kang
Developer Advocate
Developer Advocacy & Support Service
Autodesk Platform Service (formerly Forge)

0 Likes