When creating a location with the following request getting an error.
{
“meta”:{
“id”:“yourTestLocation”
},
“name”:“Your Test Location”,
“address”:{
“line1”:“205 Main St”,
“line2”:“Suite 451”,
“city”:“McLean”,
“region”:“VA”,
“postalCode”:“22102”,
“countryCode”:“US”
},
“mainPhone”:“2125555765”
}
Error: “message”: “Entity update failed; Invalid field address.region: Value is not a valid region.; Invalid field address.postalCode: Value must be a postal code; Invalid field address.countryCode: Value must match the profile country code.”
But instead of “US” location if I will put India’s location(Eg; region: “GJ”, postalCode: “396560”) then working expected.
Hi Nihal,
Can you share your account? We passed that exact JSON to my demo account and were able to create an entity.
curl request (API key is invalid so you would replace that with your api key):
curl --location --request POST 'https://api.yext.com/v2/accounts/me/entities?api_key=INSERT&v=20220322&entityType=location' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=VcDTeD05k5MWwfLW4NmUiO9hZ1P8b39gDWVDqGFBl5w-1663277783-0-AXGObqy2swUJ8xiEp40jfShe60Lapx13vFRX7SYlUUL/lyN6hQbMteLhtAc1w+ebhhqvyVxQIUqH+zYUCCUL1yl1/Gw6CjwEc2+T02eJfdr0' \
--data-raw '{
"meta": {
"id": "yourTestLocation"
},
"name": "Your Test Location",
"address": {
"line1": "205 Main St",
"line2": "Suite 451",
"city": "McLean",
"region": "VA",
"postalCode": "22102",
"countryCode": "US"
},
"mainPhone": "2125555765"
}'
cc: @Aaron_Pavlick