The version history functionality is implemented in your personal account in Selzy. You can edit a letter you have sent before, or change the mailing list, and in this case a new version of the letter will be created. The version is the message_id that is transferred when the campaign is created with createCampaign method. The current version can be only one. You can specify in the personal account interface which version is considered relevant. When you create campaigns using API, the version history functionality is not supported: when you edit a letter that has not been previously sent within campaigns (updateEmailMessage method), message_id is not changed; when you edit a letter that has been previously sent, the result of calling the updateEmailMessage method will be a letter with a new id.
Since users can use both the API integration and the Selzy personal account, there are situations when users create new versions of a letter in the personal account. Since irrelevant versions of the letter cannot be sent, the error will be returned to the user if he tries to use message_id of an irrelevant version of the letter: «error»: «Unable to create campaign. The letter has a new version (12345678)».
The getActualMessageVersion method returns the id of the relevant version of the specified letter.
Principle of use
Syntax and URL to call the method |
getActualMessageVersion (int message_id) |
https://api.selzy.com/en/api/getActualMessageVersion?api_key=KEY&message_id=ID |
Arguments | |
api_key * | API access key. |
message_id * | Message identifier for which you need to get the id of the relevant version of the letter. |
Return value |
Example of the return value in the event of successful request:
{ "result": { "message_id": 61312345, "actual_version_id": 62814234 } } Where: actual_version_id — id of the current version of the letter. Example of the returned value in the event of an error: {"error":"error message", "code":"error code"} |