• KB Home
  • SME API
  • SME API: Instant Messengers
  • Get List of Subjects by Their Type (by-apikey)

Get List of Subjects by Their Type (by-apikey)

The method described in this article is only intended for SME.

This method retrieves all subjects that have been created in your edna dashboard.

Request Endpoint

Make a POST request to this URL: https://im.edna.io/api/im-subject/by-apikey

Request Format

In the body of the request, the subject type is passed. Possible imType variables are WHATSAPP and VIBER.

{
 "imType": "WHATSAPP"
}

Response Format

[
    {
        "id": 112,
        "subject": "SUBJECT_WA",
        "clientComment": null,
        "createdAt": null,
        "updatedAt": null,
        "status": "ACTIVE",
        "statusComment": null,
        "phone": "79000000000",
        "test": false,
        "imType": "WHATSAPP"
    }
]

If there is more than one subject, an array of subjects will be returned.

[
    {
        "id": 112,
        "subject": "SUBJECT_WA",
        "clientComment": null,
        "createdAt": null,
        "updatedAt": null,
        "status": "ACTIVE",
        "statusComment": null,
        "phone": "79000000000",
        "test": false,
        "imType": "WHATSAPP"
    },
    {
        "id": 113, 
        "subject": "SUBJECT2_WA", 
        "clientComment": null, 
        "createdAt": null, 
        "updatedAt": null, 
        "status": "BLOCKED", 
        "statusComment": null, 
        "phone": "79000000001", 
        "test": false, 
        "imType": "WHATSAPP" 
    }
]

If the client does not have a subject of the requested type, the response will be an empty array.

[ ]

Response Parameters

ParameterTypeDescription
idnumberSubject ID
subjectstringSubject name
createdAtstringSubject creation time
updatedAtstringTime of the last change to the subject
statusstringStatus of the subject in edna platform
phonestringPhone number to which the subject is registered. 

Important! For Viber, a unique code is specified.
teststringTest or work subject
imTypestringThe channel that is used for message delivery