When sending a GET request for the CustomerLocation with a LocationID the API fails with the following error “Operation is not valid due to the current state of the object." However, if the LocationID is removed the request will succeed. Meanwhile, every other object like CustomerPaymentMethod requires an ID or they will fail and report the same error.
Why is CustomerLocation different ?
Is it possible to detect if a ID is supported in the API ?
I am using version 23.200.001 and the Default endpoint.
Thank you.
Page 1 / 1
@Jedanif
the ID is/must be supported for every entity (except for inquiries).
Could you please post the complete URL that causes the error?
I believe you need to pass both CustomerID and LocationID for this to work properly:
@Jedanif and for the ID, what value do you have?
@Dmitrii Naumov I tried multiple values and none worked for the LocationID, an example would be LocationID = ‘TX-DAL’.
@RohitRattan88 I will try with both IDs and get back to you.
@Jedanif ok, I see.
So, there are two ways of referencing a record.
ID. In that case the ID is a guid value that is returned to you in “id” field of the API response. This is not the value you are sending, as you are sending “Location ID”, which is “user-friendly” identifier of the object and not the GUID value.
Using full keys of the object. In that case you need to follow the example @RohitRattan88 has provided, since the Location object has two key fields - CustomerID and LocationID
@Dmitrii Naumov
I tested with the GUID value and now I can retrieve data (for the CustomerLocation_LocationContact view) but if I use the GUID in another table that has composite keys like Bill_TaxDetails an error will be thrown.
Should GUID filtering be supported across the platform?
If no, what qualifies a view to be filtered using GUID?
@Jedanif referencing a record by GUID is supported for all top level entities