Knowledgebase

Update Subscriber

Get your subscriber information updated using simple API request with relevant information to update. Following section describes the way.

Required to Submit Json Request

Username

The email that account holder uses to login MUMARA

API Token

The API token user has generated using API Configuration section of MUMARA, also mentioned above.

Method

Method being called (Post)

Path

Path to the API file being called ('http//www.yourdomain.com/API/updateSubscriber)

Field Details

Note: Subscriber_id and list_id are required parameters to submit request to recognize the specific subscriber and list of its belonging, rest of the fields are used only when you are looking to update certain information already saved against the record of that specific subscriber, i.e. first_name parameter and its value to update the existing value with the new one.

Label/Variable 

Priority

Description

subscriber_id

Required

Subscriber ID of the subscriber you want to update

list_id

Required

ID of the list where subscriber is located

email

Optional

Email of the subscriber is required to update its information

title

Optional

Professional title, designation of the subscriber such as COO, CIO, CMO etc

first_name

Optional

First Name of the Subscriber you want to add to the list

last_name

Optional

Last Name of the Subscriber you want to add to the list

unsubscribed

Optional

Had the subscriber been marked as “Unsubscribed”? If yes then set this field with “1” while sending API request for adding subscriber information to a list. Otherwise, proceed with “0” which sets this subscriber status as default “Subscribed” within the list.

bounced

Optional

Had the subscriber been marked as “Bounced”? If yes then set this field with “1” while sending API request for adding subscriber information to a list. Otherwise, proceed with “0” which sets this subscriber status as default “Not Bounced” within the list.

create_date

Optional

 

FORMAT

Optional

What essential email format subscriber prefers to receive, HTML/ Text (h for HTML and t for Text emails)

confirmation_status 

Optional

Indicates the confirmation status of the subscriber, confirmed or not. Set this field with “1” to mark the subscriber status as “Confirmed” or proceed with “0” in case subscriber has not been confirmed yet.

city

Optional

Which city subscriber belongs to, update accordingly.

country

Optional

Which country subscriber belongs to

company

Optional

Update the company information of the subscriber

post_code

Optional

Update post code information of the subscriber’s current location

state

Optional

Which state subscriber belongs to

mobile

Optional

Update the mobile phone number of the subscriber

phone

Optional

Update the phone number of the subscriber

fax

Optional

Information of the subscriber to update into the Fax field.

Sample Request

Following request is set to update email, first name and last name of the subscriber with Subscriber ID “3” located in the list ID “2”. It will also update the custom field ID 2 with relevant data.

Note: The custom fields other than the built in (Default) custom fields, need to be updated by using the custom field ID in the API request. Like in the following sample request, default custom fields are "First Name' and "Last Name" and that doesn't need list ID to add value. While to update the field created for the "Designation" of the subscriber, custom field ID will be used, like the following  ($postData['custom_field_2'] = 'Presedent';)
$postData['subscriber_id']  = '3';
$postData['list_id']        = '2';
$postData['email']          = '[email protected]';
$postData['custom_field_2'] = 'President';
$postData['first_name']     = 'First';
$postData['last_name']      = 'Last';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/API/updateSubscriber');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, count($postData));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'APIToken: 343b1b831067b50e308e6bf93e0f06f0', 'Login: [email protected]'));
$data = curl_exec($ch);
if (curl_errno($ch)) {
   print "Error: " . curl_error($ch)
} else { 
   // Show me the result
   print ($data);
   curl_close($ch);
}

Success Response

You will get the subscriber information updated upon submitting valid request, and subscriber ID of the updated subscriber will be returned as successful response.

Status value for successfully updating subscriber will be- “success”
Data Returned- Subscriber ID

{"status":"success","response":{"Subscriber ID":"3"}} 

Erroneous Response

When you submit request with inappropriate, incorrect information.

Status value for unsuccessful submission will be-"error” 
Data Returned- Text based message describing reason of unsuccessful response

Some unsuccessful responses are as follows.

{"status":"error","response":"Subscriber not available to update"}
{"status":"error","response":"List ID is required to update subscriber"}
{"status":"error","response":"Email is required to update subscriber"}