Number allocation when issuing POST call
Hello Everyone,
I have a problem when issuing a API POST call to either the Person or Contact entity. Both entities make use of a so-called number allocation, but I seemingly cannot tap into this functionality when issuing the call.
I have tried:
- Not specifying the field in the body that I post, hoping that the (next) number would be allocated automatically. It did not, unfortunately. It left the field blank, even though the settings specifies that the field cannot be blank.
- Specifying the field and its value in the body. I did this by first making a POST call to the GetRefCountEntity agent and getting the current value of the specific RefCountId then adding 1 to that number ("Number2") - the body would look like this (abbreviated):
{
"Name": "MitTestFirma",
"OrgNr": "12341234",
"Number2": 35067,
"Emails": [
{ ...
etc etc
}
This method is not working either: When I query the GetRefCountEntity agent again after posting, the value has not changed for the specific entity.
Does anyone have a suggestion on how to get this to work - if possible.
Thank you in advance and merry Christmas.
Henrik
All Replies (3)
Hi Henrik,
You need to use the 'Get default' functionality to first get a entity with the number allocated/default values filled in, see GET Contact/default
You can then use that response to fill in your values, and then POST that.