Skip to main content

Spika 3 messenger API (1.0.0)

Download OpenAPI specification:Download

This is the api specification for Spika 3

Auth

The first step of sign-up process

The first step of sign-up process

Request Body schema: application/json
telephoneNumber
string
deviceId
string

Responses

Request samples

Content type
application/json
{
  • "telephoneNumber": "string",
  • "deviceId": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Verfiy SMS code

Verfiy SMS code

Request Body schema: application/json
code
string
deviceId
string

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "deviceId": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Invalidate access token

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Contact

Update user contact.

Client sends hashed phone number list to the server.

Request Body schema: application/json
contacts
Array of strings[ items [ 1 .. 500 ] items ]

Hashed phone numbers list

Responses

Request samples

Content type
application/json
{
  • "contacts": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get contacts

Returns users contacts

query Parameters
page
number >= 1
keyword
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

File

Upload file chunk

Upload file by chunks

Request Body schema: application/json
chunk
string

Base64 encoded text of the chunk

offset
number

The position of the chunk in the entire file

clientId
string

The random string to identify upload.

Responses

Request samples

Content type
application/json
{
  • "chunk": "string",
  • "offset": 0,
  • "clientId": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Verify file

Creates file if all chunks are uploaded and fileHash matches

Request Body schema: application/json
total
number

Total number of chunks

size
number

File size in bytes

mimeType
string

mimeType

fileName
string

File name

clientId
string

The random string to identify upload.

fileHash
string

sha256 hash of the file

type
string

The name of the another model which the file refers ex) avatar, message, group avatar

relationId
number

The id of model the file refers to.

metaData
any

File metadata

Responses

Request samples

Content type
application/json
{
  • "total": 0,
  • "size": 0,
  • "mimeType": "string",
  • "fileName": "string",
  • "clientId": "string",
  • "fileHash": "string",
  • "type": "string",
  • "relationId": 0,
  • "metaData": null
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get file

Get file by id

path Parameters
id
required
string

fileId

Responses

Room

Get rooms

Get all rooms belongs to the user

query Parameters
page
number >= 1
keyword
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Add new room

Add new room

Request Body schema: application/json
name
string
avatarFileId
integer
userIds
Array of integers
adminUserIds
Array of integers
type
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "avatarFileId": 0,
  • "userIds": [
    ],
  • "adminUserIds": [
    ],
  • "type": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get private room

Use this API to check if there is private room with user

path Parameters
userId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get room detail

Get room detail by id

path Parameters
id
required
number

room id

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "users": [
    ],
  • "avatarFileId": 0,
  • "muted": true,
  • "pinned": true,
  • "deleted": true,
  • "type": "string",
  • "unreadCount": 0,
  • "createdAt": 0,
  • "modifiedAt": 0
}

update a room

update a room

path Parameters
id
required
number

room id

Request Body schema: application/json
action
string
Enum: "addGroupUsers" "removeGroupUsers" "addGroupAdmins" "removeGroupAdmins" "changeGroupName" "changeGroupAvatar"
name
string
avatarFileId
integer
userIds
Array of integers

Responses

Request samples

Content type
application/json
{
  • "action": "addGroupUsers",
  • "name": "string",
  • "avatarFileId": 0,
  • "userIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete room

Delete room

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Leave room

Leave room

path Parameters
id
required
number
Request Body schema: application/json
adminUserIds
Array of integers[ items non-empty ]

if user is last admin he must spec adminUserIds to create new admins

Responses

Request samples

Content type
application/json
{
  • "adminUserIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Mute room

Mute room

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Unmute room

Unmute room

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Pin room

Pin room

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Unpin room

Unpin room

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get unread counts

Get unread counts for all rooms. Rooms with no unread messages are not returned

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get modified rooms after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get group message rooms

Get group message rooms

query Parameters
keyword
required
string
cursor
required
number

Responses

Response samples

Content type
application/json
{
  • "groupMessageRoomList": [
    ],
  • "count": 0,
  • "limit": 0,
  • "nextCursor": 0
}

Get recent chats

Get recent chats

Responses

Response samples

Content type
application/json
{
  • "recentUserChats": [
    ],
  • "recentGroupChats": [
    ]
}

Message

Send message

Send messsage

Request Body schema: application/json
roomId
integer
type
string
Enum: "text" "video" "audio" "file" "image"
object
localId
string
replyId
number

Responses

Request samples

Content type
application/json
{
  • "roomId": 0,
  • "type": "text",
  • "body": {
    },
  • "localId": "string",
  • "replyId": 0
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update message

Update message, only available if message type is text

path Parameters
id
required
number
Request Body schema: application/json
text
string

Responses

Request samples

Content type
application/json
{
  • "text": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

delete message

delete message

path Parameters
id
required
number
query Parameters
target
required
string
Enum: "all" "user"

Responses

Get room messages

Get messages from specific room

path Parameters
roomId
required
string
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all messages received after the timestamp

Get all messages received after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all messages modified after the timestamp

Get all messages modified after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all message records for specific message

Get all message records for specific message

path Parameters
messageId
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Flag messages as delivered

Notify backend messages are saved in client side.

Request Body schema: application/json
messageIds
Array of numbers[ items non-empty ]

Responses

Request samples

Content type
application/json
{
  • "messageIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Flag all room messages as seen

Notify backend when message are shown in the client side first time.

path Parameters
roomId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Forward messages

Forward messages

Request Body schema: application/json
roomIds
Array of numbers[ items non-empty ]
messageIds
Array of numbers[ items non-empty ]
userIds
Array of numbers[ items non-empty ]

Responses

Request samples

Content type
application/json
{
  • "roomIds": [
    ],
  • "messageIds": [
    ],
  • "userIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Share message

Share message on mobile

Request Body schema: application/json
roomIds
Array of numbers
Array of objects
userIds
Array of numbers

Responses

Request samples

Content type
application/json
{
  • "roomIds": [
    ],
  • "messages": [
    ],
  • "userIds": [
    ]
}

Response samples

Content type
application/json
{
  • "messages": [
    ],
  • "newRooms": [
    ]
}

Get oldest room message date

Get oldest room message date

path Parameters
roomId
required
number

Responses

Response samples

Content type
application/json
{
  • "messageDate": "2019-08-24"
}

Get message batch by target message

Get message batch by target message

path Parameters
roomId
required
number
query Parameters
targetMessageId
required
number
cursorUp
number
cursorDown
number

Responses

Response samples

Content type
application/json
{
  • "list": [
    ],
  • "nextCursorUp": 0,
  • "nextCursorDown": 0,
  • "hasMoreOlderMessages": true,
  • "hasMoreNewerMessages": true
}

Get target message id by date

Get target message id by date

path Parameters
roomId
required
number
query Parameters
date
required
string

Responses

Response samples

Content type
application/json
{
  • "targetMessageId": 0
}

Get searched messages

Get searched messages

query Parameters
roomId
required
number
keyword
required
string
itemsPerBatch
required
number
cursor
number

Responses

Response samples

Content type
application/json
{
  • "list": [
    ],
  • "count": 0
}

Settings

Return server settings to client

Return server settings to client

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Sync

Get modified rooms after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all messages received after the timestamp

Get all messages received after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all messages modified after the timestamp

Get all messages modified after the timestamp

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all message records updated since last update

Get all message records updated since last update

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get updated users from specified time

Returns users models

path Parameters
timestamp
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

MessageRecord

Get all message records for specific message

Get all message records for specific message

path Parameters
messageId
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Add reaction message record

Add reaction message record

Request Body schema: application/json
messageId
number
reaction
string

Required if type is reaction

Responses

Request samples

Content type
application/json
{
  • "messageId": 0,
  • "reaction": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete reaction message record

Delete reaction message record

path Parameters
id
required
number

Responses

Get all message records updated since last update

Get all message records updated since last update

path Parameters
lastUpdate
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

User

Get authenticated user

Returns user model

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update authenticated user

Updates and returns user model

Request Body schema: application/json
telephoneNumber
string
emailAddress
string
displayName
string
avatarFileId
integer

Responses

Request samples

Content type
application/json
{
  • "telephoneNumber": "string",
  • "emailAddress": "string",
  • "displayName": "string",
  • "avatarFileId": 0
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete authenticated user

Delete authenticated user

Responses

Response samples

Content type
application/json
{
  • "deleted": true
}

Get user detail

Returns user model by id

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get updated users from specified time

Returns users models

path Parameters
timestamp
required
number
query Parameters
page
number >= 1

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

History

Get last updated rooms

Returns last updated rooms

query Parameters
page
number >= 1
keyword
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Device

Get current device

Returns device tied to current access token

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update push token

Returns device tied to current access token

Request Body schema: application/json
pushToken
string

Responses

Request samples

Content type
application/json
{
  • "pushToken": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Webhook

Get webhooks for specific room

Get webhooks by roomId

path Parameters
roomId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Create webhook for specific room

Create webhook for specific room

path Parameters
roomId
required
number
Request Body schema: application/json
url
string

Responses

Request samples

Content type
application/json
{
  • "url": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update webhook

Update webhook by id

path Parameters
id
required
number
Request Body schema: application/json
url
string

Responses

Request samples

Content type
application/json
{
  • "url": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete webhook

Delete webhook by id

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "deleted": true
}

ApiKey

Get api keys for specific room

Get api keys by roomId

path Parameters
roomId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Create api key for specific room

Create api key for specific room

path Parameters
roomId
required
number
Request Body schema: application/json
displayName
string

Responses

Request samples

Content type
application/json
{
  • "displayName": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update api key

Update api key by id

path Parameters
id
required
number
Request Body schema: application/json
displayName
string

Responses

Request samples

Content type
application/json
{
  • "displayName": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete api key

Delete api key by id

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "deleted": true
}

Block

Get blocked list

Get users blocked list

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Create block

Create block

Request Body schema: application/json
blockedId
number

Responses

Request samples

Content type
application/json
{
  • "blockedId": 0
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete block

Delete block by id

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete block for specific user

Delete block by userId

path Parameters
userId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Return block list for specific private room

Return block list for specific private room

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Note

Return room notes

Return room notes

path Parameters
roomId
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Create note

Create note

path Parameters
roomId
required
number
Request Body schema: application/json
title
string [ 1 .. 135 ] characters
content
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Return note detail

Return note detail

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete note

Delete note by id

path Parameters
id
required
number

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Update note

Update note by id

path Parameters
id
required
number
Request Body schema: application/json
title
string [ 1 .. 135 ] characters
content
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Media

Get media

Get all images and videos of room

query Parameters
roomId
required
number
cursor
required
number
take
number
fetchNewer
boolean
fetchOlder
boolean

Responses

Response samples

Content type
application/json
{
  • "list": {
    },
  • "hasMoreOlderImages": true,
  • "hasMoreNewerImages": true
}