Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

getMessage method

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

It is a method to get information about SMS or email message.

Principle of use

Syntax and URL to call the method
getMessage (int id)
https://api.unisender.com/en/api/getMessage?id=ID&api_key=KEY

 

Arguments
id * id — 31-bit positive integer, message identifier. Such identifiers are returned using the createEmailMessage and createSmsMessage methods. The id can be transferred as a single number or as an array to receive several letters (see the example below).
api_key * API access key

 

Return value
JSON array, each array element is an object of the letter with the following fields:

  • id — 31-bit positive integer, message identifier.
  • sub_user_login — either the login of the sub-user who created the letter, or NULL if the letter was created by the master user.
  • sender_email (only if the message is an email) — the sender's email.
  • sender_name (only if the message is an email) — the sender's name.
  • sender (only if the message is an sms) — the sender's name.
  • subject (only if the message is an email) — subject of the letter.
  • body — body of the letter.
  • text_body (only if the message is an email) — text version of the letter body.
  • list_id — ID of the campaign list.
  • created — letter creation date and time in the YYYY-MM-DD HH:MM:SS format
  • last_update — date and time of the last change in the letter in the YYYY-MM-DD HH:MM:SS format. For example: 2013-09-15 05:38:11.
  • service_type — email type (email or sms).
  • lang_code (only if the message is an email) — two-letter language code to be automatically added to the letter with the unsubscribe form (for example, "ru", "en").
  • active_version_id — ID of the letter version.
  • message_format — returns the manner of creating a message: block — block editor, raw_html — html editor, text — text version of the letter.
  • wrap_type (only if the message is an email) — alignment of the text in the letter.
    Possible options:
    1. skip — alignment is not performed.
    2. left — left alignment.
    3. center — center alignment.
    4. right — right alignment.
  • images_behavior — (only if the message is an email) — the manner of transfer of pictures in the letter. Possible options:
    1. only_links — images are not transferred, links are added instead.
    2. attachments — pictures are transferred as attachments to the letter.
    3. smart_mode — it is not used at the moment.

Пример:

{"result":[
    {
        "id":"3771225",
        "sub_user_login":null,
        "list_id":"910533",
        "created": "2010-02-23 13:29:51",
        "last_update":"2013-09-02 07:35:17",
        "service_type":"email",
        "lang_code":"ru",
        "active_version_id":null,
        "message_format":"raw_html",
        "wrap_type":"left",
        "images_behavior":"only_links",
        "sender_email":"test@unisender.com",
        "sender_name":"UniSender",
        "subject":"Message Subject",
        "body":"<p>Message body</p>",
        "text_body":"Message body"
    }
    ]
}
Оцените, на сколько вам показалась полезной статья «getMessage method»
(0)

Did we answer to your question?

0
0