Messaging Service


Messaging Service


Create a new message for an user
Resource: messages 

URLhttps://api-stage.bimplus.net/v2/messages

Examplehttps://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).
When 'Id' is user id, must be defined also 'email' string property with email address of the user. Email will be sent only to this address.
When 'Id' is group id, email will be sent to all users which belongs to this group.

senderoptionalobjectsender user object (contains id & email)
idmandatorystring(guid)id of the user
emailmandatorystringemail 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

timestampwill be ignoredstringCreation date of the message
unreadEmailoptionalboolean

When 'unreadEmail' is missing the default value is true.
If set to true or default, the message will me marked as an email ( yet unread ), and sent via email service.
If it is set as false the message will be marked as a "read" (collect) email.

unreadBrowserNotificationoptionalboolean

When 'unreadBrowserNotification' is missing the default value is true.
If set to true or default, the message will be marked as browser notification ( yet unread ) and send to the Bimplus portal as popup message.
If it is set as false the message will be marked as a "read" (collect) browser notification.

additionalDataoptionalstringExtra info
correlationIdoptionalguidId of the other related message
 POST

Create a new message for an user or group of users.
When message is created as 'read' (i.e. unreadBrowserNotification or unreadEmail is set to false), such messages are not sent immediatelly but only collected in server.

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
Resource: user/<user_id>/messages 

URLhttps://api-stage.bimplus.net/v2/user/<user_id>/messages

Examplehttps://api-stage.bimplus.net/v2/user/123456789/messages

 GET
 Gets the message list of the current user
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
Resource: messages 

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>

Examplehttps://api-stage.bimplus.net/v2/messages/<message_id>


 GET
 Get information about a specified message
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
}


Modify content of the dashboard message
Resource: messages/<message_id>/updatedashboardadditionaldata

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>/updatedashboardadditionaldata

Examplehttps://api-stage.bimplus.net/v2/messages/b8615afc-99cc-4bcd-b0ca-ff0593ce15c6/updatedashboardadditionaldata

JSON Structure

Name

Mandatory / Optional

Type

Description

additionalData

mandatory

object

The content of the message

JSON Structure of the object additionalData

Name

Mandatory / Optional

Type

Description

title

mandatory

string

Title of the message

content

mandatory

string

Message text content

imageBase64   
optionalstring
pictureLink
optionalstring
messageLink
optionalstring
 PUT
 Update the content of the message
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
{
  "additionalData":{
    "title":"Anothermessage",
    "content":"Loremipsumdolorsitamet,consetetursadipscingelitr",
    "imageBase64":null,
    "pictureLink":"http://blog.bimplus.net/wp-content/uploads/2014/08/bim-manager-300x222.png",
    "messageLink":""
  }
}
Status: 200 OK
{
    "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"
}


Delete the specified message
Resource: messages/<message_id> 

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>

Examplehttps://api-stage.bimplus.net/v2/messages/<message_id>

 DELETE
 Delete the specified message.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK


Mark a browser message as "read"
Resource: messages/<message_id>/markasreadbrowser 

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>/markasreadbrowser 

Examplehttps://api-stage.bimplus.net/v2/messages/<message_id>/markasreadbrowser 

 POST
 Mark a message as read by browser.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK
Mark a browser message as "unread"
Resource: messages/<message_id>/markasunreadbrowser 

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>/markasunreadbrowser 

Examplehttps://api-stage.bimplus.net/v2/messages/<message_id>/markasunreadbrowser 

 POST
 Mark a message as unread by browser.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK
Mark an email message as "unread"
Resource: messages/<message_id>/markasunreademail 

URLhttps://api-stage.bimplus.net/v2/messages/<message_id>/markasunreademail

Examplehttps://api-stage.bimplus.net/v2/messages/<message_id>/markasunreademail

 POST
 Mark an email message as unread.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK

Filter the messages (eg: Get all the unread messages from a particular user)
Resource: messages?filter=<property><operator><value>%26<property><operator><value>%26....

URLhttps://api-stage.bimplus.net/v2/messages?filter=unread=true%26receiver.email=customer@bimplus.net%26source=IssueService

Examplehttps://api-stage.bimplus.net/v2/messages?filter=unread=true%26receiver.email=customer@bimplus.net%26source=IssueService

where "%26" is the escape character for "&"

 GET
 Get information about a specified message
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
    }
]

Get all messages sent by given user to all single users
Resource: user/<user_id>/messages/sent

URLhttps://api-stage.bimplus.net/v2/user/<user_id>/messages/sent

Examplehttps://api-stage.bimplus.net/v2/user/1110ac3b-fa49-e540-ac2f-8caff3dd72ed/messages/sent

 GET

Gets the list of all messages sent from user (user_id) to all single users

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 all messages sent by given user to all groups
Resource: user/<user_id>/messages/groupsent

URLhttps://api-stage.bimplus.net/v2/user/<user_id>/messages/groupsent

Examplehttps://api-stage.bimplus.net/v2/user/1110ac3b-fa49-e540-ac2f-8caff3dd72ed/messages/groupsent

 GET

Gets the list of all messages sent from user (user_id) to all users groups

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,
    "groupId":"0c82421d-1ca9-4b6a-b6bb-eb5ddcb79760"
  },
  {
    "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,
    "groupId":"0c82421d-1ca9-4b6a-b6bb-eb5ddcb79760"
  }
]

Create a new messaging group
Resource: messages/systemgroups

URLhttps://api-stage.bimplus.net/v2/ messages/systemgroups

Examplehttps://api-stage.bimplus.net/v2/messages/systemgroups

JSON Structure

Name

Mandatory / Optional

Type

Description

systemGroup

mandatory

object

The object contains information about group to be created where :

  • Id is optional property as string(guid)
  • name mandatory property as string. Must be unique name
  • description option property as string
usersIdList

mandatory

list of string(guid)

List of user id’s belonging to the group. User list requires valid user identifiers.

 POST

Create a new messaging group with members.The content json object contains information about group (id, name, description) and list of user id’s belonging to the group. User list requires valid user identifiers.

Hint : Before post is recommended to check existence of a group with wanted name because creation of groups with existing name is forbiden.

Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
{
  "systemGroup":{
    "name":"Bimplusdevelopers",
    "description":"GroupofBimplusdevelopers"
  },
  "usersIdList":["61c9c325-52a2-21b5-47b6-0a06e7152ff9",
    "6be10633-5950-319f-eae0-12dec2c04219",
    "2e798f29-4b71-15ee-90eb-18592bc18317"
  ]
}
Status: 201 Created
{
  "systemGroup":{
    "id":"df0f426c-b972-4c16-9839-c77ac5930bcc",
    "name":"Bimplusdevelopers",
    "description":"GroupofBimplusdevelopers"
  },
  "usersIdList":["61c9c325-52a2-21b5-47b6-0a06e7152ff9",
    "6be10633-5950-319f-eae0-12dec2c04219",
    "2e798f29-4b71-15ee-90eb-18592bc18317"
  ]
}

Get all messaging groups
Resource: messages/systemgroups 

URLhttps://api-stage.bimplus.net/v2/ messages/systemgroups

Examplehttps://api-stage.bimplus.net/v2/messages/systemgroups

 GET
 Gets all existing messaging groups.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK
[{
    "systemGroup":{
      "id":"9c3c8a6c-67b5-406f-a44c-0dca6eb3c031",
      "name":"Users from Munich",
      "description":"Group of users from Munich area"
    },
    "usersIdList":["6ae90098-5b01-4141-8ef5-0079ae6c1c04",
      "9d32f46b-157f-dfee-a5d7-0162543dc304",
      "a33e89a2-b5fc-408a-b4ec-01fb593e2b1d"
    ]
  },
  {
    "systemGroup":{
      "id":"242fab5a-fce6-4413-900b-5f5b6ca2a414",
      "name":"Users from Paris",
      "description":"Group of users from Paris"
    },
    "usersIdList":["61c9c325-52a2-21b5-47b6-0a06e7152ff9",
      "6be10633-5950-319f-eae0-12dec2c04219",
      "2e798f29-4b71-15ee-90eb-18592bc18317"
    ]
  }
]

Get the messaging group details
Resource: messages/systemgroups/<messaginggroup_id>

URLhttps://api-stage.bimplus.net/v2/ messages/systemgroups/<messaginggroup_id>

Examplehttps://api-stage.bimplus.net/v2/messages/systemgroups/242fab5a-fce6-4413-900b-5f5b6ca2a414

 GET
 Get details of a specified messaging group. Description of returned json in Create a new messaging group.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK
{
  "systemGroup":{
    "id":"242fab5a-fce6-4413-900b-5f5b6ca2a414",
    "name":"Bimplusdevelopers",
    "description":""
  },
  "usersIdList":["61c9c325-52a2-21b5-47b6-0a06e7152ff9",
    "6be10633-5950-319f-eae0-12dec2c04219",
    "3b638075-24cd-cb2b-5464-fa955d2bd1e0"
  ]
}

Delete the messaging group
Resource: messages/systemgroups/<messaginggroup_id>

URLhttps://api-stage.bimplus.net/v2/ messages/systemgroups/<messaginggroup_id>

Examplehttps://api-stage.bimplus.net/v2/messages/systemgroups/242fab5a-fce6-4413-900b-5f5b6ca2a414

 DELETE
 Deletes a specified messaging group.
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Status: 200 OK