Solved

OData API error messages (TSFMessages)

  • 2 July 2020
  • 1 reply
  • 138 views

Userlevel 5
Badge +15

I'm experimenting with the OData API and I was wondering what the possible response messages are in case of exceptions / errors.

I found out that there's a response header provided called “TSFMessages”, which is base64 encoded. Decoding this value gives a result like below:

{
"MessageType": "ApplicationDbMessage",
"RawMessage": "<msg id=\"import_error\"></msg>",
"MessageID": null,
"NamedParameters": null
}

Is there an overview of all MessageTypes? E.g. what can I expect? And what do the other parameters do?

icon

Best answer by Vincent Doppenberg 8 July 2020, 10:50

View original

1 reply

Userlevel 6
Badge +4

Hello René,

The TSFMessages header has not been documented because we assumed it would only be used by our own GUIs. With that said, Indicium can return the following MessageTypes:

  • IndiciumMessage. These are messages produced by Indicium and only contain a MessageID and NamedParameters.
  • ApplicationDbMessage. These are messages produced by tsf_send_message and only contain a RawMessage with the XML produced by that procedure.
  • TechnicalDbMessage. These are error messages produced by the database, for instance a primary key a violation. They contain a MessageID and NamedParameters.

The MessageID property can map to a message in the application model (you can define messages in the SF with their translations for various languages). The NamedParameters property is a JSON array containing JSON objects with the properties Key and Value. These parameters depend on the message but typically contain context information for the message, such as the name of the table the message applies to. The value of Key can be used in the translation, enclosed by brackets, like {table} and a GUI will replace that placeholder by the value of Value.

Reply