Subscriber

In this Article:

  1. GET /apiv2/subscriber/{id}
  2. POST /apiv2/subscriber/
  3. PUT /apiv2/subscriber/{id}
  4. GET /apiv2/subscriber/{email_address}
  5. PUT /apiv2/subscriber/{email_address}

GET /apiv2/subscriber/{id}

Get a single subscriber and its full details.

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found under Options in Publisher Management Portal
apiSign YES MD5 string of all parameters signed by the SECRET

POST /apiv2/subscriber/

Creates a new subscriber

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found under Options in Publisher Management Portal
apiSign YES MD5 string of all parameters signed by the SECRET

Parameters

The subscriber data must be posted as a RAW JSON string.

The list below shows the fields available:

Field Type Required Description
email string NO The email address of the subscriber. You must provide either email address or mobile.
mobile string NO The mobile number of the subscriber. You must provide either email address or mobile.
name string NO The name of the subscriber
first_name string NO The first name of the subscriber
last_name string NO The last name of the subscriber
country string NO The country of the subscriber in ISO 3166-1 alpha-2 code. For more information http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
gender enum NO The gender of the subscriber. Valid values are
  • M
  • F
age_group string NO The age group of the subscriber. Valid values are
  • 15-24
  • 15-24
  • 35-44
  • 45-54
  • 55-64
  • 64+
zip string NO The zip / postcode of the subscriber
ip string NO The IP address of the subscriber
fingerprint string NO The browser fingerprint of the subscriber
os string NO The operating system of the subscriber
device string NO The device / browser of the subscriber
send_sms boolean NO Send subscriber sms with the subscription url
send_email boolean NO Send subscriber email with the subscription url
category string/enum YES The category of the application used by the subscriber. Valid values are
  • Tablet
  • Phone
  • Desktop
application string/enum YES The application the subscriber is using. Valid values are
  • iphone
  • android
  • windowslive
  • outlook
  • ical
  • apple
  • google
  • other
calendarIds array CONDITIONAL The list of the calendar ids that the subscriber has subscribed to. Required when eventIds is not set.
eventIds array CONDITIONAL The list of the event ids that the subscriber has subscribed to. Required when calendarIds is not set.
subscriptionWidgetId string NO The id of the subscription widget which the subscriber originated from
standardWidgetId string NO The id of the standard widget which the subscriber originated from
optin bit NO Values set must be either 0 (default) or 1. If it is set to 1 it indicates that the subscriber has optin to your marketing campaign / T&C / Privacy Policy
secondary_optin bit NO Values set must be either 0 (default) or 1. If it is set to 1 it indicates that the subscriber has optin to your marketing marketing campaign / T&C / Privacy Policy

Sample POST JSON Data

Request

{
   "email"       : "support@ecal.net",
   "category"    : "Mobile",
   "application" : "iphone",
   "calendarIds" : ["522923edb499924a39000067", "522923edb499924a39000068"] ,
   "eventIds"    : ["55e4509ff8894e92110041a7", "55e4505ef8894e9a110041a7"]
}

Response

{
    "status"       :"200",
    "statusLong"   :"OK",
    "subscriberId" :"52535f0db49992bd4e000000",
    "calendarUrl"  : {
        "webCalUrl"    : "webcal:\/\/e-qo.de\/2xb.ics",
        "httpCalUrl"   : "http:\/\/e-qo.de\/2xb",
        "httpsCalUrl"  : "https:\/\/e-qo.de\/2xc"
    }
}

PUT /apiv2/subscriber/{id}

Update subscriber based on id

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found under Options in Publisher Management Portal
apiSign YES MD5 string of all parameters signed by the SECRET

Parameters

The subscriber data must be posted as a RAW JSON string.

The list below shows the fields available:

Field Type Required Description
email string NO The email address of the subscriber. You must provide either email address or mobile.
mobile string NO The mobile number of the subscriber. You must provide either email address or mobile.
name string NO The name of the subscriber
first_name string NO The first name of the subscriber
last_name string NO The last name of the subscriber
country string NO The country of the subscriber in ISO 3166-1 alpha-2 code. For more information http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
gender enum NO The gender of the subscriber. Valid values are
  • M
  • F
age_group string NO The age group of the subscriber. Valid values are
  • 15-24
  • 15-24
  • 35-44
  • 45-54
  • 55-64
  • 64+
zip string NO The zip / postcode of the subscriber
calendarIds array CONDITIONAL The list of the calendar ids that the subscriber has subscribed to. Required when eventIds is not set.
calendar_action string/enum NO Indicates if the calendar ids provided will be merged with the live subscription or replaced. Valid values are
  • merge (Default)
  • replace
eventIds array CONDITIONAL The list of the event ids that the subscriber has subscribed to. Required when calendarIds is not set.
event_action string/enum NO Indicates if the event ids provided will be merged with the live subscription or replaced. Valid values are
  • merge (Default)
  • replace
optin bit NO Values set must be either 0 (default) or 1. If it is set to 1 it indicates that the subscriber has optin to your marketing campaign / T&C / Privacy Policy
secondary_optin bit NO Values set must be either 0 (default) or 1. If it is set to 1 it indicates that the subscriber has optin to your marketing campaign / T&C / Privacy Policy

Sample PUT JSON Data

Request

{
   "calendarIds" : ["522923edb499924a39000069"],
   "calendar_action" : "replace",
   "eventIds" : ["55e4509ff8894e92110041a7"],
   "event_action" : "merge" //default action
}

Response

{
    "status"       :"200",
    "statusLong"   :"OK",
    "subscriberId" :"52535f0db49992bd4e000000",
    "calendarUrl"  : {
        "webCalUrl"    : "webcal:\/\/e-qo.de\/2xb.ics",
        "httpCalUrl"   : "http:\/\/e-qo.de\/2xb",
        "httpsCalUrl"  : "https:\/\/e-qo.de\/2xc"
    }
}

GET /apiv2/subscriber/{email_address}

Get an existing subscription of a publisher’s calendar.

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found under Options in Publisher Management Portal
apiSign YES MD5 string of all parameters signed by the SECRET

PUT /apiv2/subscriber/{email_address}

Update subscriber based on email address.

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found under Options in Publisher Management Portal
apiSign YES MD5 string of all parameters signed by the SECRET

Parameters

The subscriber data must be posted as a RAW JSON string.

Refer to PUT /apiv2/subscriber/{id} for field reference.