Skip to main content
Solved

OData API error messages (TSFMessages)

  • July 2, 2020
  • 1 reply
  • 157 views

Forum|alt.badge.img+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?

Best answer by Vincent Doppenberg

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.

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings