Desk Platform API v1
Desk Platform API
Desk Platform API
Version 1

Customer archive

Copy link

The Customer archive API allows you to archive a customer with their related information and chat messages. Once archived, the existing customer data is subsequently deleted from both Sendbird server and the Desk server and is irreversible after the deletion. Then, you can only retrieve customer archives or request a download link to a specific archive.

Note: Customers from social media can't be archived.


Resource representation

Copy link

The following table shows the list of properties in a customer archive resource.

Property nameTypeDescription

id

int

The unique ID of the customer archive.

project

int

The unique ID of the project.

customerId

int

The unique ID of the archived customer. The value is null if a customer only has a Sendbird ID.

sendbirdId

string

The unique Sendbird ID of the customer, which is identical to a user ID in Sendbird Chat.

createdAt

string

The date and time when the customer archive is created, in ISO 8601 format.

archiveStatus

string

The status that indicates whether the customer is archived. Valid values are the following: PENDING, IN_PROGRESS, DONE, and FAILED. Once the value changes to DONE, the archived customer data is downloadable through the provided URL.

deletionStatus

string

The status that indicates whether the customer information is deleted from the Desk server. Valid values are the following: PENDING, IN_PROGRESS, DONE, and FAILED. The deletion process begins once the value of archiveStatus changes to DONE.


Actions

Copy link
  • API endpoints are relative to the base URL allocated to your application. On this page, the /customers endpoint refers to https://desk-api-{application_id}.sendbird.com/platform/v1/customers.

Note: If you want to know your application ID, sign in to your dashboard, go to the Settings > Application > General, and then check the Application ID.

  • It's recommended that the parameter values in API URLs be urlencoded, such as {customer_archive_id}.

List of actions

Copy link
ActionHTTP request

List customer archives

GET /customer_archives
Retrieves a list of customer archives.

View a customer archive

GET /customer_archives/{archive_id}
Retrieves a customer archive.

Archive a customer

POST /customer_archives
Archives a customer and its related information, including chat messages.

Request a download link

GET /customer_archives/{archive_id}/download
Requests a download link to a specific customer archive.


List customer archives

Copy link

Retrieves a list of customer archives.

HTTP request

Copy link
GET https://desk-api-{application_id}.sendbird.com/platform/v1/customer_archives

Parameters

Copy link

The following table lists the parameters that this action supports.

Optional
Parameter nameTypeDescription

customer_id

int

Searches for customer archives of a user with the specified ID.

sendbird_id

string

Searches for customer archives of a user with the specified Sendbird ID.

start_date

string

Specifies a starting date of the search scope to retrieve archives created between start_date and end_date, in YYYY-MM-DD format.

end_date

string

Specifies an ending date of the search scope to retrieve archives created between start_date and end_date, in YYYY-MM-DD format.

limit

int

Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50)

offset

int

Specifies the number of results to skip when receiving a response. The value of offset is also used as the starting index of each page. (Default: 0)

/?start_date=2022-01-13&end_date=2022-01-20&limit=100&offset=0

Response

Copy link

If successful, this action returns a list of customer archive resources in the response body.

{
    "count": 10,
    "previous": None,
    "next": "https://desk-api-{sendbird_app_id}.sendbird.com/project/platform/v1/customer_archives/?limit=50&offset50",
    "result": [
        {
            "id": 1,
            "project": 1,
            "customerId": 17,
            "sendbirdId": "duskan",
            "createdAt": "2021-07-07 17:32:16.32",
            "archiveStatus": "IN_PROGRESS",
            "deletionStatus": "PENDING"
        },
        ...# More archives
    ]
}

List of response properties

Copy link
Property nameTypeDescription

count

int

The total count of customers registered in the application.

previous

string

The URL to retrieve the previous page in the result set.

next

string

The URL to retrieve the next page in the result set.

results[]

list

A list of customers.


View a customer archive

Copy link

Retrieves a specific customer archive.

HTTP request

Copy link
GET https://desk-api-{application_id}.sendbird.com/platform/v1/customer_archives/{archive_id}

Parameters

Copy link

The following table lists the parameters that this action supports.

Required
Parameter nameTypeDescription

archive_id

int

Specifies a unique ID of a customer archive.

Response

Copy link

If successful, this action returns a customer archive resource in the response body.


Archive a customer

Copy link

Archives a customer and its related information, including chat messages.

HTTP request

Copy link
POST https://desk-api-{application_id}.sendbird.com/platform/v1/customer_archives

Request body

Copy link

The following table lists the parameters that this action supports.

Required
Property nameTypeDescription

sendbirdId

string

Specifies a unique Sendbird ID of a customer to archive, which is identical to a user ID in Sendbird Chat.

Response

Copy link

If successful, this action returns a customer archive resource in the response body.


Requests a download link to a specific customer archive.

Note: The URL expires after 30 minutes.

GET https://desk-api-{application_id}.sendbird.com/platform/v1/customer_archives/{archive_id}/download

The following table lists the parameters that this action supports.

Required
Parameter nameTypeDescription

archive_id

int

Specifies a unique ID of a customer archive.

If successful, this action returns a customer archive with a link to a requested customer archive.

{
    "id": 1,
    "project": 1,
    "customerId": 17,
    "sendbirdId": "cindy",
    "createdAt": "2021-07-07 17:32:16.32",
    "archiveStatus": "DONE",
    "deletionStatus": "DONE",
    "url": "https://s3.amazonaws.com/......",
}