Hi,
I’m just playing around at the moment, whilst looking for a cloud DB with REST API and server code. So far, you’re looking good?
However, I’ve set up two tables: Clients and Tags
Clients is returning the following data on an unfiltered GET request:
{
"offset": 0,
"data": [
{
"wp_id": 1,
"crm_id": "456",
"billing_id": "123",
"created": 1457214390000,
"___class": "Clients",
"ownerId": null,
"updated": null,
"objectId": "67F12CEB-AE48-BFD9-FFFD-1A9A7D036900",
"__meta": "{\"relationRemovalIds\":{},\"selectedProperties\":[\"wp_id\",\"crm_id\",\"billing_id\",\"created\",\"___class\",\"ownerId\",\"updated\",\"objectId\"],\"relatedObjects\":{}}"
}
],
"nextPage": null,
"totalObjects": 1
}
And tags is set up with a relationship from the tag to the client (one client to many tags).
So, by reckoning, if I want to create a tag for that client, I need to use the relationship field in the tag and assign it the object id of the client, using:
POST
{
"title": "Customers",
"client_id": "67F12CEB-AE48-BFD9-FFFD-1A9A7D036900"
}
However, this is returning the error:
{
"code": 1007,
"message": "Unable to save object - invalid data type for properties - client_id. You can change the property type in developer console."
}
Attached is the tags schema screenshot.
Any ideas what I’m doing wrong?
Regards,
Andy