I’ve tried all the similar solutions to people who had the same problem and I keep getting “Got a result missing the "id" property”. Following is the structure of my returned data (the first ‘id’ =12 is the id):
{
"data":
{
"type": "stage",
"id": 12,
"attributes": {
"color": "#9bedcf",
"createdAt": "2021-03-05T17:54:49.000Z",
"name": "Becoming KLT",
"order": 2,
"updatedAt": "2021-03-11T17:19:02.000Z"
},
"relationships": {
"creator": {
"data": {
"type": "user",
"id": 1
}
},
"prospects": {
"links": {
"related": "https://api..."
}
},
"updater": {
"data": {
"type": "user",
"id": 1
}
}
},
"links": {
"self": "https://api..."
}
}
]
}
Following is my current code
const options = {
url: 'https://apiURL/api/v2/stages',
method: 'GET',
headers: {
'Accept': 'application',
'Authorization': `Bearer ${bundle.authData.access_token}`
},
params: {
}
}
return z.request(options).then((response) => {
response.throwForStatus();
const result = z.JSON.parse(response.content);
result.id = result.id;
return result];
});
And I’m getting the following error:
Invalid API Response:
- Got a result missing the "id" property ({"data":t{"type":"stage","id":1,"attributes":{"color":"#e8eefe","createdAt":"2021-01-29T23:43:13.000Z","name":"Cold / Not Started","order":1,"updatedAt":"2021-02-16T23:53:40.000Z"},"relationships":{"creator":{"data":null},"prospects":{"links":{"relat)
What happened (You are seeing this because you are an admin):
Executing triggers.get_stages.operation.perform with bundle
Please help!!!