Create an equipment
https://carchost.fieldcontrol.com.br/equipmentsCreates an equipment belonging to a customer (customer) or kept in a storage (storage), already with the answers to the custom fields.
Requires the
X-Api-Key,User-AgentandContent-Type: application/jsonheaders. Limit: 1 request per second (learn more).
Request
Headers
User-AgentstringrequiredIdentification of your application.
Example: MinhaIntegracao/1.0.
Request body
JSON, sent with the Content-Type: application/json header.
namestringrequiredEquipment name.
From 5 to 150 characters.
numberstringrequiredSerial number. Must be unique in the account.
From 1 to 150 characters.
notesstringEquipment notes.
Up to 500 characters.Accepts: null.
qrCodestringQR code. Must be unique in the account. Up to 150 characters, or 255 when it is a public Field Control QR code URL (contains /qrcode-publico/#/ or /equipamentos/gerador-qrcodes/#/).
Accepts: null.
avatarUrlstringURL of the equipment photo.
Up to 150 characters.Accepts: null.
archivedbooleanArchives the equipment.
Default: false.
typeobjectrequiredEquipment type, by id or by name (exact name). If both are sent, id wins.
Fields of type
idstringEquipment type identifier.
namestringEquipment type name.
From 5 to 150 characters.
customerobjectCustomer who owns the equipment, by id or by name (exact name). If both are sent, id wins.
Fields of customer
idstringCustomer identifier.
namestringCustomer name.
From 5 to 150 characters.
locationobjectCustomer location where the equipment is.
Fields of location
idstringrequiredLocation identifier.
storageobjectStorage where the equipment is kept.
Fields of storage
idstringrequiredStorage identifier.
customFieldslist of objectsAnswers to the custom fields of the equipment type. On update, when sent, it replaces all current answers.
A field with a display condition (set in the Manager Panel) is only shown when the trigger has the expected answer among the answers sent. Answering a hidden field returns 422 (hidden by condition), and a required field with a condition that becomes visible without an answer returns 422 (required).
Fields of customFields
namestringrequiredField name, the same as registered in the equipment type.
From 5 to 150 characters.
valuestringrequiredAnswer. In multiple-choice, it must be one of the registered options.
From 1 to 500 characters.
typestringrequiredField type.
Accepted values: question, date, multiple-choice, number.
positionstringDisplay position.
Up to 150 characters.Accepts: null.
Responses
- 201
Equipment created. The response does not include
labelsorstatus. - 401
API key missing (
Missing API Key) or invalid (Invalid API Key). See Authentication. - 403
Account blocked (
Account blocked), expired (Account expired) or on a plan that does not allow integration (Account plan not allowed). See Authentication. - 422
Invalid body (resourceValidationErr):
customerandstoragemissing,numberorqrCodealready used in the account (reason: duplicated), type or customer not found by name (reason: not found), or custom field answer with a nonexistent name, type or option. - 429
Limit of 1 request per second exceeded. See Rate limit.
- 500
Unexpected server error.