General information

Operators

There may be several types of operators in method conditions.

Text:

  • EQUALS, NOT_EQUALS – Compare text literally. Case insensitive.
  • CONTAINS, NOT_CONTAINS – Compare text with wild chars. Use % for any string and _ for one character. Case insensitive.

Numeric:

  • LESS, LESS_OR_EQUALS, EQUALS, GREATER_OR_EQUALS, GREATER – Compare numbers. Use . (dot) as decimal part separator if needed.

Time:

  • FROM, TO, AT – Compare dates in YYYY-MM-DD format.

Warning: Operators must be UPPERCASED.

 

IDs in conditions

In many methods IDs may be passed to conditions. Method get_messages will be used as an example of how to do it.

 [ "API_KEY", { "campaigns" : [ "CAMPAIGN_ID", "CAMPAIGN_ID" ], "get_campaigns" : { get_campaigns conditions }, ... } ] 

Method expects a list of campaigns in conditions to narrow down search results. Those campaigns may be given as an array of CAMPAIGN_ID values obtained from get_campaigns.

 [ "API_KEY", { "campaigns" : [ "4b1b5", "b35f2b" ] } ] 

It will return messages from those two specific campaigns. But sometimes it is faster/easier to nest get_campaigns conditions in get_messages method.

 [ "API_KEY", "name": {"CONTAINS" : "my_campaign_%" } } ] 

It will return messages from campaigns that have a name beginning with my_campaign_. Pretty easy, isn’t it?

Hint: Nesting of conditions is also legal. For example send_newsletter conditions may contain get_contacts conditions which may contain get_links conditions which may contain get_messages conditions which may contain get_campaigns conditions. Everything in one request!

Warning: Do not use campaigns when you mean get_campaigns. And the other way round. Condition campaigns expects array of CAMPAIGN_ID values while condition get_campaigns expects get_campaigns method conditions. Same for messages/get_messages, contacts/get_contacts and others.

Warning: Do not provide text where ID is expected. This is incorrect.

 "campaigns" : [ "my_campaign_1" ] 

Errors

Field error format is compatible with JSON-RPC 2.0 spec.

Errors not included in spec:

  • Invalid API key.
 { "code" : -1, "message" : "API key verification failed" } 
  • Client IP not from trusted network (GetResponse 360 only)
 { "code" : -1, "message" : "API client IP not allowed" } 
  • Method error, list of message values in this error is provided in method documentation.
 { "code" : -1, "message" : "..." } 

Flags

For methods 'send_newsletter', 'add_draft' and 'add_autoresponder' there is optional field (of type array) named flags that may be present with following items:

  • clicktrack – Clicks on links in message are counted.  Note that for the link to be click-tracked it must be also wrapped in {{LINK}} tag. This behaves differently than web interface, where (for simplicity) all links are click-tracked when click-track checkbox is set.
  • subscription_reminder – Short disclaimer is added to the message content to make sure that subscriber know why they are receiving the messages.
  • openrate – Opened messages are counted (only if html content is present).
  • google_analytics – Google Analytics code is appended to every link in message.