External ID validation.

External ID validation.

I added an external ID field as below in one of my custom modules:



When creating records via the API using some value (eg: 762115b2-097e-43b2-bdba-f3924a5371a6) for this field, it works without any problem. I can create and even see the records on the crm dashboard.

However, when I delete those records from the CRM and try to recreate them via the API again, I get the following error response:

  1. {
  2.   "code": "INVALID_DATA",
  3.   "details": {
  4.     "platform_order_id": "762115b2-097e-43b2-bdba-f3924a5371a6"
  5.   },
  6.   "message": "the external id given seems to be invalid",
  7.   "status": "error"
  8. }
Why does it seem to be invalid? As I said above, I was able to create a record with this ID and it worked fine. After deleting that record from the CRM and trying the same API call again, I get this error.

Why?

As a hack, when I manually modify this id string (eg: "XXX762115b2-097e-43b2-bdba-f3924a5371a6XXX", it works. What is the validation logic for external IDs that I am missing here?