Special logic has been built in for country fields, so that the Display Name, 2 character, or 3 character ISO code can be provided in create or update requests without needing to specify which value is supplied. For read requests, one of the types can be provided in the URI.
The API has special handling built in for interacting with attributes that link to Country fields in AssignmentPro, specifically when sending POST and PATCH requests to create or update records
Requests can be made with the display value of the country, for either the 2Char or 3Char ISO code, without explicitly specifying what has been provided via a query string parameter when creating or updating records with the API and the country will be inserted as expected - a POST request with the values provided in the body like the below example will result in the correct countries being set:
The response back will default to returning the 3Char ISO code for each of the country fields
If a value other than the 3Char ISO code is desired when executing a GET request, the lookup query string parameter can be used to specify what should be returned in the response:
The response back after executing the request
Things to note when using Country Fields:
3Char ISO codes are returned by default for GET requests, and in the response body for POST or PATCH requests
When a value other than the 3Char ISO code is desired in response to a GET request, use the lookup field query string parameter syntax
The available lookup types for country fields are
isoCode2Char
displayValue
identifier (default/3Char ISO code)
When sending values for countries in a POST or PATCH request, nothing needs to be specified - the API has intelligence around these fields to map the provided values to the correct countries




