Logbook
An API allows to send notifications to the elogbook. The signature of this method can be found here
Signature of the method is:
POST http://{server}:{port}/dataacquisition/{apiKey}/notification
Form data is composed by a json with the type, category and content of the notification. Example:
{
"type":"notification",
"category":"info",
"content":[
{
"text":"This is a info message",
"format":"plainText"
}
],
"creationDate":"2019-10-07T14:56:42.417368"
}
Example:
curl -X POST "https://icatplus.esrf.fr/dataacquisition/83825a51-69b8-4eg58-b5fb-bcf79bb412be/notification?investigationName=ELOG-0001&instrumentName=ID00" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"type\":\"notification\",\"tag\":[{\"name\":\"string\"}],\"category\":\"info\",\"content\":[{\"format\":\"plainText\",\"text\":\"This is an info message\"}],\"creationDate\":\"2019-10-07T14:56:42.417368\"}"
Types
There are 3 types:
- notification
- annotation
- broadcast
Categories
There are several type of categories:
- info
- error
- debug
- commandLine
- comment
Format
Plain Text
{
"type":"notification",
"category":"info",
"content":[
{
"text":"This is a info message",
"format":"plainText"
}],
"creationDate":"2019-10-07T14:56:42.417368"
}
HTML
HTML is also supported when format=html
{
"type":"notification",
"category":"info",
"content":[
{
"text":"This is a more sophisticated HTML info message containing 1 table that was generated by the CURL command below
<table class=\ "table table-striped table-condensed table-hover\">
<tbody>
<tr>
<td>m2angle</td>
<td class=\ "value\">26</td>
</tr>
<tr>
<td>m0tz</td>
<td class=\ "value\">-22</td>
</tr>
[...............]
<tr>
<td>rotz</td>
<td class=\ "value\">NaN</td>
</tr>
<tr>
<td>tilt</td>
<td class=\ "value\">0</td>
</tr>
</tbody>
</table>",
"format":"html"
}
],
"creationDate":"2019-10-07T14:56:42.417368"
}