Discussions

Ask a Question
Back to All

Create a procedure in a work order that doesn't have one yet

How do you create a procedure in a work order that doesn't have one yet?

This is not working and I'm not sure what else to try.

base_url = url + 'api/v1/base/WoProcedure/'  

    payload = {  
        "Properties" : ["WorkOrderId", "ID", "DisplayAs"],  
        "Entity": {  
            "WorkOrderId" : workOrderId,  
            "ID" : 1111,  
            "DisplayAs" : "ProcedureName"  
            },  
        "Comment" : "Test"  
    }

query_json = json.dumps(payload)

company_name_stage = "CompanyName"
# Set required headers as defined by the Corrigo REST API Documentation
headers = {
    "CompanyName": company_name_stage,
    "Authorization": f'Bearer {access_token_stage}',
    "Content-Type": 'application/json'
    }

## execute workorder PUT query
response = requests.request("PUT", base_url, data=query_json, headers=headers, verify=False)

Thanks,
Laura