Update File Field

Prev Next

The 'update file field' API endpoint is used to update one file field on an object using a TeamTracks Edit view. This is a POST request where the object values are passed as form-data in the request body. The API returns '200 OK' when successful.

Update File Field

The following POST endpoint uploads a file to a file field on an object based on a specific edit view:

https://api.team-tracks.com/object/{viewId}/{objectId}/upload?fieldId={fieldId}

This endpoint requires the id of an edit view in the system and the id of the object to be updated. Unlike updating an object, the file to be uploaded is passed as multipart/form-data.

 The call should include the below headers.

Authorization: "Bearer <token>"
tenant: <your_tenent_ID>
Ocp-Apim-Subscription-Key: <your_subscription_key>

Arguments

The following arguments are supported by the endpoint:

Argument

Values

Description

lookupObjectByName

true/false

If set to true, you can use the Object Name for {objectId}. Object name is the field value corresponding to the ID Field of the object. Default is false.

lookupFieldByName

true/false

If set to true, you can use the Field Name for {fieldId}. Field Name is the actual name of the field. Default is false.

Example URL when using arguments

'https://api.team-tracks.com/object/2a884c8c-cfc3-441f-b4a7-6748f073bdfa/RMA12345/upload?fieldId=RepairQuote&lookupObjectByName=true&lookupFieldByName=true'

Full curl

curl --location 'https://api.team-tracks.com/object/{viewId}/RMA12345/upload?fieldId=RepairQuote&lookupObjectByName=true&lookupFieldByName=true' \
--header 'tenant: <your_tenent_ID>' \
--header 'Ocp-Apim-Subscription-Key: <your_subscription_key>' \
--header 'Authorization: Bearer <token>' \
--form 'file=@"/pathto/file.pdf"'