1. Chat

1.1. List conversations

HTTP
GET /v3/chat?unread=false&excludeEmpty=false HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
HTTPie
$ http GET 'https://api.clinked.com/v3/chat?unread=false&excludeEmpty=false' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat?unread=false&excludeEmpty=false' -i -X GET \
    -H 'Authorization: Bearer <YOUR-TOKEN>'
{title_response_success}
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 940

[ {
  "id" : "test",
  "name" : "test",
  "type" : "direct",
  "user" : {
    "id" : 2,
    "name" : "Black Sheep",
    "username" : "another.user",
    "logo" : false,
    "jobTitle" : "Marketing",
    "lastModified" : 1514764800000
  },
  "participants" : [ {
    "id" : "uri:user:jack:1",
    "user" : {
      "id" : 1,
      "name" : "Jack Bauer",
      "username" : "jack",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Jack Bauer",
    "properties" : [ "nothumb" ]
  }, {
    "id" : "uri:user:another.user:2",
    "user" : {
      "id" : 2,
      "name" : "Black Sheep",
      "username" : "another.user",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Black Sheep",
    "properties" : [ "nothumb" ]
  } ],
  "unread" : false,
  "lastMessage" : null,
  "dateCreated" : 1713790760397,
  "account" : 1
} ]
Table 1. {title_response_fields}
Path Type Description

[].id

String

Conversation ID

[].name

String

Name

[].type

String

Type of conversation. Either 'direct' or 'group'

[].group

Object

Group if type is 'group'

[].account

Number

Account ID

[].user

Object

User if type is 'direct'

[].unread

Boolean

True when there are unread messages for the user

[].lastMessage

Object

Last message

[].account

Number

Account id

[].dateCreated

Number

Date conversation was created

[].participants

Array

List of participants in conversation

[].participants[].id

String

Participant URI

[].participants[].user

Object

Participant user info

[].participants[].name

String

Participant full name

[].participants[].properties

Array

Additional participant properties

[].participants[].user.id

Number

User id

[].participants[].user.name

String

Full name

[].participants[].user.username

String

Username

[].participants[].user.logo

Boolean

Profile picture is defined

[].participants[].user.jobTitle

String

Job title

[].participants[].user.lastModified

Number

Last modified date

[].user.id

Number

User id

[].user.name

String

Full name

[].user.username

String

Username

[].user.logo

Boolean

Profile picture is defined

[].user.jobTitle

String

Job title

[].user.lastModified

Number

Last modified date

[].group.id

Number

User / profile id

[].group.name

String

Group name slug, used for internal identification and URIs

[].group.friendlyName

String

Full group name, visible to a user

1.2. Get conversation

Table 2. /v3/chat/{conversation}
Parameter Description

conversation

Conversation ID

HTTP
GET /v3/chat/test HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
HTTPie
$ http GET 'https://api.clinked.com/v3/chat/test' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat/test' -i -X GET \
    -H 'Authorization: Bearer <YOUR-TOKEN>'
{title_response_success}
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 936

{
  "id" : "test",
  "name" : "test",
  "type" : "direct",
  "user" : {
    "id" : 2,
    "name" : "Black Sheep",
    "username" : "another.user",
    "logo" : false,
    "jobTitle" : "Marketing",
    "lastModified" : 1514764800000
  },
  "participants" : [ {
    "id" : "uri:user:jack:1",
    "user" : {
      "id" : 1,
      "name" : "Jack Bauer",
      "username" : "jack",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Jack Bauer",
    "properties" : [ "nothumb" ]
  }, {
    "id" : "uri:user:another.user:2",
    "user" : {
      "id" : 2,
      "name" : "Black Sheep",
      "username" : "another.user",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Black Sheep",
    "properties" : [ "nothumb" ]
  } ],
  "unread" : false,
  "lastMessage" : null,
  "dateCreated" : 1713790760377,
  "account" : 1
}
Table 3. {title_response_fields}
Path Type Description

id

String

Conversation ID

name

String

Name

type

String

Type of conversation. Either 'direct' or 'group'

group

Object

Group if type is 'group'

account

Number

Account ID

user

Object

User if type is 'direct'

unread

Boolean

True when there are unread messages for the user

lastMessage

Object

Last message

account

Number

Account id

dateCreated

Number

Date conversation was created

participants

Array

List of participants in conversation

participants[].id

String

Participant URI

participants[].user

Object

Participant user info

participants[].name

String

Participant full name

participants[].properties

Array

Additional participant properties

participants[].user.id

Number

User id

participants[].user.name

String

Full name

participants[].user.username

String

Username

participants[].user.logo

Boolean

Profile picture is defined

participants[].user.jobTitle

String

Job title

participants[].user.lastModified

Number

Last modified date

user.id

Number

User id

user.name

String

Full name

user.username

String

Username

user.logo

Boolean

Profile picture is defined

user.jobTitle

String

Job title

user.lastModified

Number

Last modified date

group.id

Number

User / profile id

group.name

String

Group name slug, used for internal identification and URIs

group.friendlyName

String

Full group name, visible to a user

1.3. Create conversation

HTTP
POST /v3/chat HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 26

{"account": 1, "user": 2 }
HTTPie
$ echo '{"account": 1, "user": 2 }' | http POST 'https://api.clinked.com/v3/chat' \
    'Content-Type:application/json' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <YOUR-TOKEN>' \
    -d '{"account": 1, "user": 2 }'
Table 4. {title_request_fields}
Path Type Description

account

Number

Account id

user

Number

User id

group

Number

Group id

{title_response_success}
HTTP/1.1 201 Created
Location: https://api.clinked.com/v3/chat/test
Content-Type: application/json;charset=UTF-8
Content-Length: 936

{
  "id" : "test",
  "name" : "test",
  "type" : "direct",
  "user" : {
    "id" : 2,
    "name" : "Black Sheep",
    "username" : "another.user",
    "logo" : false,
    "jobTitle" : "Marketing",
    "lastModified" : 1514764800000
  },
  "participants" : [ {
    "id" : "uri:user:another.user:2",
    "user" : {
      "id" : 2,
      "name" : "Black Sheep",
      "username" : "another.user",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Black Sheep",
    "properties" : [ "nothumb" ]
  }, {
    "id" : "uri:user:jack:1",
    "user" : {
      "id" : 1,
      "name" : "Jack Bauer",
      "username" : "jack",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Jack Bauer",
    "properties" : [ "nothumb" ]
  } ],
  "unread" : false,
  "lastMessage" : null,
  "dateCreated" : 1713790760434,
  "account" : 1
}
Table 5. {title_response_fields}
Path Type Description

id

String

Conversation ID

name

String

Name

type

String

Type of conversation. Either 'direct' or 'group'

group

Object

Group if type is 'group'

account

Number

Account ID

user

Object

User if type is 'direct'

unread

Boolean

True when there are unread messages for the user

lastMessage

Object

Last message

account

Number

Account id

dateCreated

Number

Date conversation was created

participants

Array

List of participants in conversation

participants[].id

String

Participant URI

participants[].user

Object

Participant user info

participants[].name

String

Participant full name

participants[].properties

Array

Additional participant properties

participants[].user.id

Number

User id

participants[].user.name

String

Full name

participants[].user.username

String

Username

participants[].user.logo

Boolean

Profile picture is defined

participants[].user.jobTitle

String

Job title

participants[].user.lastModified

Number

Last modified date

user.id

Number

User id

user.name

String

Full name

user.username

String

Username

user.logo

Boolean

Profile picture is defined

user.jobTitle

String

Job title

user.lastModified

Number

Last modified date

group.id

Number

User / profile id

group.name

String

Group name slug, used for internal identification and URIs

group.friendlyName

String

Full group name, visible to a user

1.4. Update conversation

Sets conversation as read.

HTTP
PATCH /v3/chat/test HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 15

{"read": true }
HTTPie
$ echo '{"read": true }' | http PATCH 'https://api.clinked.com/v3/chat/test' \
    'Content-Type:application/json' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat/test' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <YOUR-TOKEN>' \
    -d '{"read": true }'
Table 6. {title_request_fields}
Path Type Description

read

Boolean

Is read

{title_response_success}
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 936

{
  "id" : "test",
  "name" : "test",
  "type" : "direct",
  "user" : {
    "id" : 2,
    "name" : "Black Sheep",
    "username" : "another.user",
    "logo" : false,
    "jobTitle" : "Marketing",
    "lastModified" : 1514764800000
  },
  "participants" : [ {
    "id" : "uri:user:jack:1",
    "user" : {
      "id" : 1,
      "name" : "Jack Bauer",
      "username" : "jack",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Jack Bauer",
    "properties" : [ "nothumb" ]
  }, {
    "id" : "uri:user:another.user:2",
    "user" : {
      "id" : 2,
      "name" : "Black Sheep",
      "username" : "another.user",
      "logo" : false,
      "jobTitle" : "Marketing",
      "lastModified" : 1514764800000
    },
    "name" : "Black Sheep",
    "properties" : [ "nothumb" ]
  } ],
  "unread" : false,
  "lastMessage" : null,
  "dateCreated" : 1713790760317,
  "account" : 1
}
Table 7. {title_response_fields}
Path Type Description

id

String

Conversation ID

name

String

Name

type

String

Type of conversation. Either 'direct' or 'group'

group

Object

Group if type is 'group'

account

Number

Account ID

user

Object

User if type is 'direct'

unread

Boolean

True when there are unread messages for the user

lastMessage

Object

Last message

account

Number

Account id

dateCreated

Number

Date conversation was created

participants

Array

List of participants in conversation

participants[].id

String

Participant URI

participants[].user

Object

Participant user info

participants[].name

String

Participant full name

participants[].properties

Array

Additional participant properties

participants[].user.id

Number

User id

participants[].user.name

String

Full name

participants[].user.username

String

Username

participants[].user.logo

Boolean

Profile picture is defined

participants[].user.jobTitle

String

Job title

participants[].user.lastModified

Number

Last modified date

user.id

Number

User id

user.name

String

Full name

user.username

String

Username

user.logo

Boolean

Profile picture is defined

user.jobTitle

String

Job title

user.lastModified

Number

Last modified date

group.id

Number

User / profile id

group.name

String

Group name slug, used for internal identification and URIs

group.friendlyName

String

Full group name, visible to a user

1.5. Conversation messages

1.5.1. List messages

Table 8. /v3/chat/{conversation}/messages
Parameter Description

conversation

Conversation id

HTTP
GET /v3/chat/test/messages HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
HTTPie
$ http GET 'https://api.clinked.com/v3/chat/test/messages' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat/test/messages' -i -X GET \
    -H 'Authorization: Bearer <YOUR-TOKEN>'
Table 9. {title_request_parameters}
Parameter Description

offset

Message offset

markAsRead

Mark conversation as read

{title_response_success}
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 451

{
  "offset" : null,
  "items" : [ {
    "id" : "id",
    "deliveryId" : "delivery-1",
    "source" : {
      "id" : "uri:user:jack:1",
      "name" : "Jack Bauer",
      "properties" : [ "nothumb" ]
    },
    "body" : "message",
    "type" : "text",
    "read" : true,
    "messageOffset" : "dummyOffset",
    "dateSent" : "2024-04-22T12:59:20.479+0000",
    "dateReceived" : "2024-04-22T12:59:20.479+0000"
  } ],
  "size" : null,
  "more" : false
}
Table 10. {title_response_fields}
Path Type Description

offset

String

Next offset for the messages

more

Boolean

Has more messages

items

Array

Array of messages

size

Number

Page size

items[].id

String

Message ID

items[].deliveryId

String

Unique delivery ID when message in transit

items[].body

String

Message text

items[].type

String

Type of message. Either 'text', 'update' or 'type'

items[].read

Boolean

Message is read or unread

items[].dateSent

String

Date the message was sent from client

items[].dateReceived

String

Date the message was received on server

items[].source

Object

Conversation participant who sent the message

items[].source.id

String

Participant URI

items[].source.name

String

Participant full name

items[].source.properties

Array

Additional participant properties

items[].messageOffset

String

Message offset from which other messages can be paginated

1.5.2. Create message

Table 11. /v3/chat/{conversation}/messages
Parameter Description

conversation

Conversation id

HTTP
POST /v3/chat/test/messages HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 76

{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}
HTTPie
$ echo '{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}' | http POST 'https://api.clinked.com/v3/chat/test/messages' \
    'Content-Type:application/json' \
    'Authorization:Bearer <YOUR-TOKEN>'
Curl
$ curl 'https://api.clinked.com/v3/chat/test/messages' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <YOUR-TOKEN>' \
    -d '{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}'
Table 12. {title_request_fields}
Path Type Description

type

String

Message type text|update

body

String

Message text

dateSent

String

Date sent

{title_response_success}
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 401

{
  "id" : "742af97f-3011-4602-8060-540a3218a1e6",
  "deliveryId" : "cc6f7cd8-3f57-4834-97af-ce8344325587",
  "source" : {
    "id" : "uri:user:jack:1",
    "name" : "Jack Bauer",
    "properties" : [ "nothumb" ]
  },
  "body" : "Hello",
  "type" : "text",
  "read" : true,
  "messageOffset" : "dummy",
  "dateSent" : "2000-10-31T06:30:00.000+0000",
  "dateReceived" : "2024-04-22T12:59:20.545+0000"
}
Table 13. {title_response_fields}
Path Type Description

id

String

Message ID

deliveryId

String

Unique delivery ID when message in transit

body

String

Message text

type

String

Type of message. Either 'text', 'update' or 'type'

read

Boolean

Message is read or unread

dateSent

String

Date the message was sent from client

dateReceived

String

Date the message was received on server

source

Object

Conversation participant who sent the message

source.id

String

Participant URI

source.name

String

Participant full name

source.properties

Array

Additional participant properties

messageOffset

String

Message offset from which other messages can be paginated