PATCH FormInstances
Description
This API endpoint facilitates the updating of the status associated with a form instance. It allows clients to modify the status of a form instance based on their specific requirements or workflow processes.
Endpoint
• Endpoint: <environment base url>/v1.0/api/Forms/FormInstances
• Method: PATCH
Request Body
{
"formInstances": [
{
"id": "string",
"status": "string"
}
]
} `
Response Structure
`{
"data": {
"formInstances": [
{
"id": "String",
"errorMessage": "String"
}
]
}
}`
API Contract
Permitted Values
status
Code | Value |
---|---|
GEN | Generated Successfully |
SOK | Content Accepted by Government |
SDE | Content Declined by Government |
STG | Submitted to Government |
Field Specifications
- id: Mandatory in request, max length 32, ID of the generated form instance.
- id: In case of errors the id of the generated form instance is sent back, max length 32.
Additional Notes
- The API allows setting the status of a form instance based on the ID. Multiple updates are supported. The request body must have the IDs of the form instances and the appropriate status to be updated.
- If the form instances fail when updating, the API returns the ID of the failed forms and error messages.
- In case the External Reporting Entity of the form instance is inactive, updating the status results in an error.
Allowed Status Change Matrix
Sample Response
{
"data": {
"formInstances": []
}
}
Sample request [CURL]
curl --location --request PATCH 'https://exampleapi.example.net/v1.0/api/Forms/FormInstances' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer exampleToken1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' \
--header 'Cookie: incap_ses_1607_1234567=exampleCookieValue1; incap_ses_76_1234567=exampleCookieValue2; incap_ses_8216_1234567=exampleCookieValue3; nlbi_1234567=exampleCookieValue4; visid_incap_1234567=exampleCookieValue5' \
--data '{
"formInstances":[
{
"ID":"example-id-1234-5678-90ab-cdef12345678",
"Status":"GEN"
}
]
}'