Help with translationMap error

Hello,

I'm trying to get some data out of Topdesk with an API call.
The data that i'm trying to get is if a person has an attention and then the attention name value.
The action works if a person does have a attention name value but fails if empty:

{
  "message": "Failed while processing the translation map. Could not resolve value for the key: 'attentionName' and no default value was configured. Additional details: Expected to find an object with property ['name'] in path $[0]['attention'] but found 'null'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.",
  "code": "bad.request",
  "status": 400,
  "messageParams": {},
  "contextId": "e3d6772c-d2e3-45e3-aff6-75901b083194",
  "details": [
    {
      "errorCode": "ACTION.PROCESSING"
    }
  ],
  "errors": []
}

There are two scenarios that can happen:
The person has attention and the api responds:

"hasAttention": true,
    "attention": {
      "id": "911f9c21-b7a3-4a14-b3d9-2d8e0b9498ce",
      "name": "A-klant"

Or the person has no attention and the api responds:

"hasAttention": false,

The error happens when the persons attention name value is empty in Topdesk.
The API doesn't respond with "name": when it's empty in Topdesk
How can I fix that the data action doesn't fail if the value is empty?
I've already tried to give the attentionName string a default value in the output contracts, but that doesn't work.

Seems like you need to configure your "translationMapDefaults" to fix this.

--Jason

Hello Jason,

Thank you!

Adding the code below to the response JSON worked.

 "translationMapDefaults": {
    "attentionName": "\"\""
  },

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.