Message API

Description

Easily create a messaging service

Pricing per Call: 0.001$
For learn the packages and usage details of the services, go to the pricing page.

End Points

post/createUser

Creates a new user in the system.

Parameters
FieldDescriptionTypeHeaderRequired
IdentifierThe user's phone number or e-mail address.text
nameUser name and surname.text
Example
Request
{
  "uri": "https://api.collectapi.com/message/createUser",
  "body": {
    "phone": "555-5555555",
    "name": "Test User"
  },
  "headers": {
    "Authorization": "apikey your_token"
  }
}
Response
{
  "success": true,
  "result": [
    {
      "message": "Kullanıcı başarıyla oluşturulumuştur.",
      "name": "Test User",
      "phone": "555-5555555",
      "userID": "123456"
    }
  ]
}
post/createConversation

Service that starts a new conversation between two users.

Parameters
FieldDescriptionTypeHeaderRequired
fromIDEnter User ID.text
toIDEnter User ID.text
Example
Request
{
  "uri": "https://api.collectapi.com/message/createConversation",
  "body": {
    "fromID": "10000",
    "toID": "20000"
  },
  "headers": {
    "Authorization": "apikey your_token"
  }
}
Response
{
  "success": true,
  "result": [
    {
      "message": "Konuşma başlatılmıştır.",
      "conversationID": "500000",
      "from": {
        "name": "Test User",
        "userID": "10000"
      },
      "to": {
        "name": "Test User2",
        "userID": "20000"
      }
    }
  ]
}
post/getHistory

Conversation ID is the service that brings the conversation history by entering.

Parameters
FieldDescriptionTypeHeaderRequired
conversationIDEnter the ID of the conversation you want to see.text
limitEnter how many messages are shown at a time.int
Example
Request
{
  "uri": "https://api.collectapi.com/message/getHistory",
  "body": {
    "conversationID": "500000",
    "limit": 20
  },
  "headers": {
    "Authorization": "apikey your_token"
  }
}
Response
{
  "success": true,
  "result": [
    {
      "message": {
        "type": "text",
        "text": "Nasılsın"
      },
      "conversationID": "500000",
      "request_date": "2019-01-14T06:44:44.381Z",
      "response_date": "2019-01-14T06:44:44.683Z",
      "response": [
        {
          "type": "text",
          "text": "İyiyim. Sen nasılsın"
        }
      ]
    },
    "..."
  ]
}
post/sendMessage

Message sending service from one person to another.

Parameters
FieldDescriptionTypeHeaderRequired
fromIDSender id.text
toIDRecipient idtext
conversationIDConversation idtext
messageSending messagetext
Example
Request
{
  "uri": "https://api.collectapi.com/message/sendMessage",
  "body": {
    "fromID": "10000",
    "toID": "20000",
    "conversationID": "500000",
    "message": "Merhaba, nasılsın?"
  },
  "headers": {
    "Authorization": "apikey your_token"
  }
}
Response
{
  "success": true,
  "result": [
    {
      "isSend": true,
      "message": "Merhaba, nasılsın?"
    }
  ]
}