Message
    • PDF

    Message

    • PDF

    Article summary

    Provides information about the APIs for creating, editing, and deleting messages.

    Message View API Within Channel

    You can search for a specific message within a channel.

    Request URL

    GET https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/{channelId}
    

    Request headers

    HeaderDescription
    x-project-id- Dashboard > Settings > Project settings > Project ID
    x-api-key- Dashboard > Settings > Project settings > API Key

    Request path parameters

    ParameterTypeRequiredDescription
    channelIdStringOChannel ID

    Request query parameters

    ParameterTypeRequiredDescription
    filterStringOUse {} to enter.
    sortStringXDefine the filter for the fields you want to sort. e.g., Descending order {"created_at":"-1"} / ascending order {"created_at":"1"}
    optionStringXRefer to the following when there are options. ex) {"offset":0,"per_page":20}

    Request examples

    curl -X 'GET' \
      'https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/339c2b1c-d35b-47f2-828d-xxxxxxxxxxx?filter=%7B%7D&sort=%7B%22created_at%22%3A%22-1%22%7D&option=%7B%22offset%22%3A0%2C%22per_page%22%3A20%7D' \
      -H 'accept: application/json' \
      -H 'x-project-id: 339c2b1c-d35b-47f2-828d-xxxxxxxxx' \
      -H 'x-api-key: 4302925661f70ce7c1406c59543f2546xxxxxxxxxxxxxx'
    
    

    Response examples (normal)

    
    [
      {
        "id": "644219bf0210fafxxxxxxx",
        "message_id": "644219bf0210faf7fxxxxxxx",
        "channel_id": "d6b52237-aebe-4509-81d1-xxxxxxxxxxx",
        "sort_id": "1682053567257",
        "message_type": "text",
        "sender": {
          "id": "guest-5159",
          "name": "GUEST-5159",
          "profile": "https://loremflickr.com/640/360"
        },
        "admin": {
          "id": "",
          "name": "",
          "profile": ""
        },
        "attachment_filenames": {
          "name": "",
          "size": 0,
          "type": "text",
          "url": ""
        },
        "has": "",
        "embed_providers": "",
        "embed_type": "",
        "isExpress": false,
        "link_hostnames": "",
        "mentions": [],
        "mentions_everyone": "false",
        "content": "hippo",
        "sended_at": "2023-04-21T14:06:07+09:00",
        "created_at": "2023-04-21T14:06:07+09:00"
      },
      {
        "id": "6441f2150117ce7d4f93c5da",
        "message_id": "6441f2150117ce7d4fxxxxxxx",
        "channel_id": "d6b52237-aebe-4509-81d1-8937xxxxxxx",
        "sort_id": "1682043413705",
        "message_type": "text",
        "sender": {
          "id": "guest-1964",
          "name": "GUEST-1964",
          "profile": "https://loremflickr.com/640/360"
        },
        "admin": {
          "id": "",
          "name": "",
          "profile": ""
        },
        "attachment_filenames": {
          "name": "",
          "size": 0,
          "type": "text",
          "url": ""
        },
        "has": "",
        "embed_providers": "",
        "embed_type": "",
        "isExpress": false,
        "link_hostnames": "",
        "mentions": [],
        "mentions_everyone": "false",
        "content": "hello",
        "sended_at": "2023-04-21T11:16:53+09:00",
        "created_at": "2023-04-21T11:16:53+09:00"
      }]
    
    

    Responses

    Returned as HTTP status codes in the response body.

    HTTP status codeResponse messageDescription
    200OKGeneral successful request
    400Bad RequestUsed for general request failure (usually used to respond to a request format that the server can't understand)
    500Internal Server Error- Response code for common server errors
    - 4XX error codes are used to represent client-side errors
    - 5XX error codes represent server-side errors

    View individual messages within channel

    Can extract specific messages from specific channels.

    Request URL

    GET https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/{channelId}/{messageId}
    

    Request headers

    HeaderDescription
    x-project-id- Dashboard > Settings > Project settings > Project ID
    x-api-key- Dashboard > Settings > Project settings > API Key

    Request path parameters

    ParameterTypeRequiredDescription
    channelIdStringYChannel ID
    messageIdStringYMessage ID

    Request examples

    curl -X 'GET' \
      'https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/bb63b36f-4642-40c3-XXXX-XXXXXXXXXX/62b40c6deaadXXXXXXXX' \
      -H 'accept: application/json' \
      -H 'x-project-id: 339c2b1c-d35b-47f2-828d-xxxxxxxxx' \
      -H 'x-api-key: 4302925661f70ce7c14xxxxxxxxxxxxxxxxxxxx'
    
    

    Response examples (normal)

      {
      "id": "62b40c6deaadXXXXXXXX",
      "message_id": "62b40c6deaadXXXXXXXX",
      "channel_id": "bb63b36f-4642-40c3-XXXX-XXXXXXXXXX",
      "sort_id": "1655966829820",
      "message_type": "text",
      "sender": {
        "id": "XXXXXX",
        "name": "tester2",
        "profile": null
      },
      "admin": {
        "id": "XXXXXX",
        "name": "tester2",
        "profile": null
      },
      "attachment_filenames": {
        "name": "",
        "size": null,
        "type": "text",
        "url": null
      },
      "has": "",
      "embed_providers": "",
      "embed_type": "",
      "isExpress": null,
      "link_hostnames": "",
      "mentions": [],
      "mentions_everyone": "false",
      "content": "msg TEXT",
      "sended_at": null,
      "created_at": "2022-06-23T15:47:09+09:00"
    }
     
    

    Responses

    Returned as HTTP status codes in the response body.

    HTTP status codeResponse messageDescription
    200OKGeneral successful request
    400Bad RequestUsed for general request failure (usually used to respond to a request format that the server can't understand)
    500Internal Server Error- Response code for common server errors
    - 4XX error codes are used to represent client-side errors
    - 5XX error codes represent server-side errors

    Message creation API

    You can send messages within a channel.

    Request URL

    POST https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages
    

    Request headers

    HeaderDescription
    x-project-id- Dashboard > Settings > Project settings > Project ID
    x-api-key- Dashboard > Settings > Project settings > API Key

    Request body parameters

    ParameterTypeRequiredDescription
    contentStringYMessage
    Message length limit

    The maximum message text length is determined by the value of the message length setting in the project settings.

    Request examples

    curl -X 'POST' \
      'https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/d6b52237-aebe-4509-XXXX-XXXXXXX' \
      -H 'accept: application/json' \
      -H 'x-project-id: 339c2b1c-d35b-47f2-828d-xxxxxxxxxx' \
      -H 'x-api-key: 4302925661f70ce7c1406c59543f2546dxxxxxxxxxx' \
      -H 'Content-Type: application/json' \
      -d '{
      "content": "new Message"
    }'
    
    

    Response examples (normal)

     {
      "message": {
        "id": "64488985d0172afd5axxxxxxx",
        "message_id": "64488985d0172afd5axxxxxx",
        "channel_id": "d6b52237-aebe-4509-81d1-xxxxxxxx",
        "sort_id": "1682475397355",
        "message_type": "text",
        "sender": {
          "id": "f8002d46-3064-4d42-XXXX-XXXXXXX",
          "name": "TEST",
          "profile": null
        },
        "admin": {
          "id": "f8002d46-3064-4d42-XXXX-XXXXXXX",
          "name": "TEST",
          "profile": null
        },
        "attachment_filenames": {
          "name": "",
          "size": 0,
          "type": "text",
          "url": ""
        },
        "has": "",
        "embed_providers": "",
        "embed_type": "",
        "isExpress": false,
        "link_hostnames": "",
        "mentions": [],
        "mentions_everyone": "false",
        "content": "new Message",
        "sended_at": "2023-04-26T11:16:37+09:00",
        "created_at": "2023-04-26T11:16:37+09:00"
      },
      "status": 1
    }
     
    

    Responses

    Returned as HTTP status codes in the response body.

    HTTP status codeResponse messageDescription
    200OKGeneral successful request
    400Bad RequestUsed for general request failure (usually used to respond to a request format that the server can't understand)
    500Internal Server Error- Response code for common server errors
    - 4XX error codes are used to represent client-side errors
    - 5XX error codes represent server-side errors

    Message deletion API

    You can delete specific messages.

    Request URL

    DELETE https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/:channelId/:messageId
    

    Request headers

    HeaderDescription
    x-project-id- Dashboard > Settings > Project settings > Project ID
    x-api-key- Dashboard > Settings > Project settings > API Key

    Request path parameters

    ParameterTypeRequiredDescription
    channelIdStringYChannel ID
    messageIdStringYMessage ID

    Request examples

    curl -X 'DELETE' \
      'https://dashboard-api.ncloudchat.naverncp.com/v1/api/messages/ac712308-95d7-4c9a-bba7-xxxxxxxxxx/63cad8c3faac16dxxxxxxxx' \
      -H 'accept: */*' \
      -H 'x-project-id: 339c2b1c-d35b-47f2-828d-5f02axxxxxxx' \
      -H 'x-api-key: 4302925661f70ce7c1406c59543f2546d261d2xxxxxxx'
    
    

    Response examples (normal)

     {
      "message": {
        "id": "63cad8c3faac16dxxxxxx",
        "message_id": "63cad8c3faac16dxxxxxxxx",
        "channel_id": "ac712308-95d7-4c9a-bba7-xxxxxxxxxx",
        "sort_id": "1674238147614",
        "message_type": "text",
        "sender": {
          "id": "0e596be1-2ef0-4a79-a105-09a47xxxxxx",
          "name": "User",
          "profile": "https://cloudchat.gcdn.ntruss.com/samples/2.jpeg"
        },
        "admin": {
          "id": "0e596be1-2ef0-4a79-a105-09a47xxxxxxx",
          "name": "User",
          "profile": "https://cloudchat.gcdn.ntruss.com/samples/2.jpeg"
        },
        "attachment_filenames": {
          "name": "",
          "size": 0,
          "type": "text",
          "url": ""
        },
        "has": "",
        "embed_providers": "",
        "embed_type": "",
        "isExpress": false,
        "link_hostnames": "",
        "mentions": [],
        "mentions_everyone": "false",
        "content": "Hellooooooo",
        "sended_at": "2023-01-21T03:09:07+09:00",
        "created_at": "2023-01-21T03:09:07+09:00"
      },
      "status": 1
    }
     
    

    Responses

    Returned as HTTP status codes in the response body.

    HTTP status codeResponse messageDescription
    200OKGeneral successful request
    400Bad RequestUsed for general request failure (usually used to respond to a request format that the server can't understand)
    500Internal Server Error- Response code for common server errors
    - 4XX error codes are used to represent client-side errors
    - 5XX error codes represent server-side errors

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.