HTTP Error 422
I had an import which loads salesforce data into Anaplan using the RestAPI fail today with the 422 error code below:
{ "status": { "code": 422, "message": "Unprocessable Entity" }, "path": "/2/0/workspaces/8a81b08e5cdbe172015cfb45189104ca/models/43955D63B8BD4E3FA3EA72776BE2CC41/files/113000000080", "timestamp": "2022-02-02T22:58:40.507838Z" }
It took me a while to figure out the source of the error as it was not obvious based on the error code, so I wanted to share the reason for the error so it is on the community.
The 422 error means Anaplan received the request and the request was in the right format, but it couldn't process the request. In checking the reason my import failed was because the target model had been archived without me knowing.
So my integrations where sending the right information but the model was not available.
Hope this helps others avoid some needless head-scratching.
Answers
-
Good catch - the message in that response is misleading, and reflects the more standard interpretation of that status code. For completeness, per https://anaplanbulkapi20.docs.apiary.io/#/introduction/getting-started/http-responses there are four specific codes altogether:
Code Meaning 422 The model you are trying to access has been archived. 423 The model you are trying to update is locked. 424 The model you are trying to access is offline. 425 The model you are trying to change is in deployed mode. 1 -
@ben_speight Thanks for calling this out in the documentation, I have a habit of glossing over the intro and getting to the detail and didn't even think to check back to the API doc's when the error code came up. As you say I just checked the generic HTTP codes and descriptions.
0 -
The HTTP 422 Unprocessable Entity response status code indicates that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.
Regards,
J Wick0 -
Good catch - the message in that response is misleading, and reflects the more standard interpretation of that status code. For completeness, per
there are four specific codes altogether:422
The model you are trying to access has been archived.
423
The model you are trying to update is locked.
424
The model you are trying to access is offline.
425
The model you are trying to change is in deployed mode.
Thanks for sharing, tell me please 423 can it occure because it is currently being used by another user?
0