Messaging Service
- Create a new message for an user
- Get the message list of the current user
- Get information about a specified message
- Delete the specified message
- Mark a browser message as "read"
- Mark a browser message as "unread"
- Mark an email message as "unread"
- Filter the messages
Messaging Service
Create a new message for an user
URL: https://api-stage.bimplus.net/v2/messages
Example: https://api-stage.bimplus.net/v2/messages
JSON Structure:
Name |
Mandatory / Optional |
Type |
Description |
---|---|---|---|
id |
will be ignored |
string |
Id of the message |
receiver |
mandatory |
object |
receiver user object (contains id & email). |
sender | optional | object | sender user object (contains id & email) |
id | mandatory | string(guid) | id of the user |
mandatory | string | email id of the user | |
source |
mandatory |
string |
Source of the message (eg: Import Service) |
topic |
mandatory |
string |
Topic of the message |
severity |
mandatory |
object |
Severity can be Info, Warning, Error |
returnCode |
mandatory |
string |
Readable return code |
timestamp | will be ignored | string | Creation date of the message |
unreadEmail | optional | boolean | When 'unreadEmail' is missing the default value is true. |
unreadBrowserNotification | optional | boolean | When 'unreadBrowserNotification' is missing the default value is true. |
additionalData | optional | string | Extra info |
correlationId | optional | guid | Id of the other related message |
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
{ "sender": { "id": "1110ac3b-fa49-e540-ac2f-8caff3dd72ed" }, "receiver": { "id": "1e2223b-fa49-e540-ac2f-8caff3dd72ed" }, "source": "ServiceName", "topic": "SKETCHUP_JOB", "severity": "Warn", "returncode": "FILE_TOO_BIG", "unreadBrowserNotification": true }
Status: 201 Created
{ "id": "4633d522-53aa-4d81-90b4-704681e0573d", "sender": { "id": "1110ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer1@bimplus.net" }, "receiver": { "id": "1e2223b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer2@bimplus.net" }, "source": "ServiceName", "topic": "SKETCHUP_JOB", "severity": "Warn", "returncode": "FILE_TOO_BIG", "unreadBrowserNotification": true, "timestamp": "2013-11-15T10:55:53" }
Get the message list of the current user
URL: https://api-stage.bimplus.net/v2/user/<user_id>/messages
Example: https://api-stage.bimplus.net/v2/user/123456789/messages
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
[ { "id": "481713d6-7dab-410c-8c8a-d65ff1d4a766", "sender": { "id": "1110ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer1@bimplus.net" }, "receiver": { "id": "1e2223b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer2@bimplus.net" }, "source": "ServiceName2", "topic": "SKETCHUP_JOB", "severity": "Info", "returncode": "FILE_TOO_BIG", "timestamp": "2013-11-18T14:55:22", "unreadBrowserNotification": false, "unreadEmail": false, "additionaldata": null, "correlationid": null }, { "id": "93c29c5d-1391-4ae8-8876-ef9815e60f7d", "sender": { "id": "1110ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer1@bimplus.net" }, "receiver": { "id": "1e2223b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer2@bimplus.net" }, "source": "ServiceName", "topic": "IFC_JOB", "severity": "Info", "returncode": "OK", "timestamp": "2013-11-18T14:30:53", "unreadBrowserNotification": true, "unreadEmail": false, "additionaldata": null, "correlationid": null } ]
Get information about a specified message
URL: https://api-stage.bimplus.net/v2/messages/<message_id>
Example: https://api-stage.bimplus.net/v2/messages/<message_id>
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
{ "id": "93c29c5d-1391-4ae8-8876-ef9815e60f7d", "sender": { "id": "1110ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer1@bimplus.net" }, "receiver": { "id": "1e2223b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer2@bimplus.net" }, "source": "ServiceName", "topic": "IFC_JOB", "severity": "Info", "returncode": "OK", "timestamp": "2013-11-18T14:30:53", "unreadBrowserNotification": true, "unreadEmail": false, "additionaldata": null, "correlationid": null }
Delete the specified message
URL: https://api-stage.bimplus.net/v2/messages/<message_id>
Example: https://api-stage.bimplus.net/v2/messages/<message_id>
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
Mark a browser message as "read"
URL: https://api-stage.bimplus.net/v2/messages/<message_id>/markasreadbrowser
Example: https://api-stage.bimplus.net/v2/messages/<message_id>/markasreadbrowser
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
Filter the messages (eg: Get all the unread messages from a particular user)
where "%26" is the escape character for "&"
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
[ { "id": "44ad058b-1f76-4343-bafa-031eb462215c", "receiver": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer@bimplus.net" }, "sender": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "testuser1@bimplus.net" }, "source": "IssueService", "topic": "ISSUE_DELETED", "severity": "Info", "returnCode": "ISSUE_DELETED", "timestamp": "2014-05-09T09:54:17", "unreadBrowserNotification": true, "unreadEmail": false, "correlationId": null }, { "id": "0a4c8eab-26af-49ce-9191-049a141ba762", "receiver": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer@bimplus.net" }, "sender": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "testuser1@bimplus.net" }, "source": "IssueService", "topic": "ISSUE_UPDATED", "severity": "Info", "returnCode": "ISSUE_UPDATED", "timestamp": "2014-04-08T08:54:41", "unreadBrowserNotification": false, "unreadEmail": false, "correlationId": "de96f4ae-79fd-4d83-99e9-07cec7a80906" }, { "id": "ffd50096-fb82-4029-8d49-06a04e31f02a", "receiver": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "customer@bimplus.net" }, "sender": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "testuser2@bimplus.net" }, "source": "IssueService", "topic": "ISSUE_DELETED", "severity": "Info", "returnCode": "ISSUE_DELETED", "timestamp": "2014-05-09T09:54:27", "unreadBrowserNotification": false, "unreadEmail": true, "correlationId": null } ]