Welcome


Are you listening to your customers?

The Bulk API provides programmatic access to allow you to quickly load your organization's data into Clastic. To use this document, you should have a basic familiarity with software development and Web services.

Any functionality described in this guide is available only if your organization has the Bulk API feature enabled. This feature is enabled by default for Enterprise, and Developer Editions

To use Clastic API, You have to provide api id and api key in header section of each request.

How API Works


You process a set of records by creating a https request. The https request specifies which object is being processed and what type of action is being used. We processed Json object. A batch is a set of records sent to the server in an https POST request. For example:

https://api.clastic.com/v1/CreateList?UserEmail={Registered email address}

The highlighted red colour line indicates https request for a Web API Creating User. Each batch is processed independently by the server, not necessarily in the order it is received.

A Web API is created by submitting an API ID and Code representation will be as follows.

"X-ApiKey", "API_ID:API_Key”

The highlighted red colour font indicates API Key, Which will be differs from one API to another API. Once created the status of a request is represented by a code of response.

Processing data typically consists of the following steps:

  • Creating List.
  • Validating List.
  • Get List Validate Summary
  • Get All List
  • Check status of all methods at a reasonable interval. Each status check returns the state of each batch.
  • When all batches have either completed or failed, retrieve the result for each batch API is success the result will be shown in response API and if its failed it will be shown in response text.
  • Match the result sets with the original data set to determine which records failed and succeeded, and take appropriate action.

At any point in this process, you can abort the job. Aborting a job has the effect of preventing any unprocessed batches from being processed. It doesn't undo the effects of batches already processed.

Clastic APIDescriptionHow to Use?
Create ListIt will create a list of contacts to send an email.Need Registered User email address, name of the list.
Max. Allowed 25000 records per a list.
Validating ListIt returns the summary of validated list.Need Registered User email address, listId returned
from createlist method.
Get List Validate SummaryIt validates all the contacts of a list.Need Registered User email address, listId returned
from createlist method.
Get All ListIt returns all the list with details.Need Registered User email address, page number and
page per records for pagination.
Delete listIt deletes the list.Need Registered User email address, listId returned from createlist method.
Download ListIt downloads all contacts in the list.Need Registered User email address, listId returned
from createlist method.
Create campaignIts returns all details of a campaignNeed Registered User email address, CampaignID
returnedfrom CreateCampaign method.
Get CampaignIt downloads all contacts in the list.Need Registered User email address, listId returned
from createlist method.
Update CampaignIt updates all the details of a campaignNeed Registered User email address and campaign details.
Send Or Schedule CampaignIt send/schedule the campaignNeed Registered User email address and send/schedule options..
Add Sender AddressIt adds sender address(from/reply email)Need Registered User email address, senderemail and emailtype
Get Sender AddressIt returns sender address(from/reply email) by specified emailtypeNeed Registered User email address and emailtype
Get Report SummaryIt returns report summary details by campaignidNeed Registered User email address and campaignid
Export Open DetailsIt returns all opened contact details by campaignidNeed Registered User email address and campaignid
Export Click DetailsIt returns all clicked contact details by campaignidNeed Registered User email address and campaignid
Export Unsubscribe DetailsIt returns all unsubscribed contact details by campaignidNeed Registered User email address and campaignid
Export Shared DetailsIt returns all shared contact details by campaignidNeed Registered User email address and campaignid.
Export Bounce DetailsIt returns all bounced contact details by campaignidNeed Registered User email address ,bouncetype and campaignid
Get Open DetailsIt returns all opened contact details from specified
startvalue to end value by campaignid
Need Registered User email address, campaignid ,rowstart and rowend
Get Click DetailsIt returns all clicked contact details from specified startvalue to end value by campaignidNeed Registered User email address, campaignid ,rowstart and rowend
Get Unsubscribe DetailsIt returns all unsubscribed contact details from specified
startvalue to end value by campaignid
Need Registered User email address, campaignid ,rowstart and rowend
Get Share DetailsIt returns all shared contact details from specified
startvalue to end value by campaignid
Need Registered User email address, campaignid ,rowstart and rowend
Get Bounce DetailsIt returns all bounced contact details from specified
startvalue to end value by campaignid
Need Registered User email address, campaignid ,rowstart and rowend

When to Use API


API is based on REST principles and is optimized for loading or deleting large sets of data. You can create user , Assign Credits and Create List. API is optimized for real-time client applications that update small numbers of records at a time.

It can also be used for processing large numbers of records, when the data sets contain hundreds of thousands of records, it becomes less practical. Bulk API is designed to make it simple to process data from a few thousand to millions of records.

The easiest way to use Bulk API is to enable it for processing records .This avoids the need to write your own client application.

Quick Start


Use the quick start sample in this section to create https requests that insert new contact records using the REST-based API. The instructions progress through Creating User, Assigning Credits and Creating List.

In this chapter...

Note: Before you begin building integration or other client application:

  • Install your development platform according to its product documentation
  • Read through all the steps before beginning this quick start. You may also wish to review the rest of this document to familiarize yourself with terms and concepts.

Setting Up Your Client Application


The API uses https GET and https POST methods, so it's very simple to build client applications using the tool or the language of your choice. This quick start uses a c# to simplify sending and receiving https requests and responses.

Sending https Requests with URL


Now that you have configured URL, you can start sending https requests to the API. You send https requests to a URI to perform operations with Bulk API.

The URI where you send https requests has the following format:

https://api.clastic.com/v1/CreateList?UserEmail{Registered email address}&ListName={list name}

The part after the API version (Resource_address) varies depending on the job or batch being processed.

Restful API Services:


Create List

  • https Post
https://api.clastic.com/v1/CreateList?UserEmail{Registered email address}&ListName={list name}
  • How to use
    • Provide valid registered Email address and name of the List.
    • Max. Allowed 25,000 records per list.
    • List contains below fields:
      • First Name
      • Last Name
      • Email Address (Required)
      • Phone Number
      • Web Address
      • Country
      • State
      • City
      • Industry
      • Title
      • Address
      • Company Name
      • Company Fax
    • Once you provide all these fields properly you will get a message as “List Created successfully” with status “Success”
  • Limitations:
    • Email address and List name fields are mandatory.
    • If these two fields are empty it will throws an exception saying that ”Value is required”
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • List Name (String)

Get List Validation Summary:

  • https Post
https://api.clastic.com/v1/GetListValidateSummary?listId={listid}&userEmail={Registered email address}
  • How to use ?
    • Email address and ListID fields are mandatory.
    • If these two fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Limitations:
    • Provide valid registered Email address and ListID.
    • If validating process is not completed then you will return a message saying “Validating list is on progress.”
    • If validating process is completed then you will validation summary details.
  • Required Fields:
    • User Email address (String)
    • ListID (String)

Get / Retireve All List:

  • https Post
https://api.clastic.com/v1/GetAllList?PageNumber={value}&RecPerPage={value}&userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and Page Number and Rec Per Page.
    • It will return all the list as per pagination.
  • Limitations:
    • Email address and PageNumber and RecPerPage fields are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • PageNumber (Integer)
    • RecPerPage (Integer)

Delete a List:

  • https Post
https://api.clastic.com/v1/DeleteList?listId={value}&userEmail={registered email address}
  • How to use ?
    • Provide valid registered Email address and ListID
    • Once you provide all these fields properly you will get a message as “List deleted successfully” with status “Success”
  • Limitations:
    • Email address and ListID fields are mandatory.
    • If these two fields are empty it will throws an exception saying that ”Value is required”
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • ListID (String)
  • Return: It returns json with success status.

Download a List:

  • https Post
https://api.clastic.com/v1/DownloadList?listId={value}&userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and ListID
    • It returns list of contact of given listID.
  • Limitations:
    • Email address and ListID fields are mandatory.
    • If these two fields are empty it will throws an exception saying that ”Value is required”
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • ListID (String)
  • Return: It returns the list of json format with following given details.
      • FirstName (String)
      • LastName (String)
      • EmailAddress (String)
      • CompanyName (String)
      • ContactPhone (String)
      • Industry (String)
      • Title (String)
      • Country (String)
      • State (String)
      • City (String)
      • CompanyFax (String)
      • WebAddress (String)
      • Address (string)

Create a Campaign:

  • https Post
https://api.clastic.com/v1/createcampaign?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address.
    • Provide unique CampaignName which must be alphanumeric characters.
    • Provide Subject with alphanumeric and !$%,?() characters only.
    • Provide FromName with alphanumeric characters.
    • Provide ReplyTo which must be in email address format.
    • Provide From which must be in email address format.
    • Provide ListID’s separated by comma.
    • Provide TemplateContent (Email Content)
    • It returns CampaignID for created campaign.
  • Limitations:
    • Email address is mandatory.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • User Email address (String)
      • CampaignName (String)
      • Subject (String)
      • FromName (String)
      • From (String)
      • ListID (String-listId, values separated by comma)
      • TemplateContent (String)
  • Return: It returns json with success status and CampaignID.

Get Campaign:

  • https Post
https://api.clastic.com/v1/getcampaign?campaignID={value}&userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address
    • Provide valid CampaignID.
  • Limitations:
    • Email address is mandatory.
    • CampaignID is mandatory.
  • Required Fields:
    • User Email address (String)
    • CampiagnID (Integer)
  • Return: It returns json format with following given details.
  • CampaignName (String)
  • Subject (String)
  • FromName (String)
  • ReplyTo (String)
  • From (String)
  • ListID (String)
  • TemplateContent (String)
  • CampaignID (Integer)
  • CampaignStatus (String)

Update Campaign:

  • https Post
https://api.clastic.com/v1/updatecampaign?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address .
    • Provide modified unique CampaignName which must be alphanumeric characters.
    • Provide modified Subject with alphanumeric and !'$%,.?|:()_#%&®\[\] -] characters only.
    • Provide modified FromName with alphanumeric characters.
    • Provide modified ReplyTo which must be in email address format.
    • Provide modified From which must be in email address format.
    • Provide modified ListID’s separated by comma.
    • Provide modified TemplateContent (Email Content)
    • Provide the Valid CampaignID which will be modified.
  • Limitations:
    • Email address is mandatory.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • Given below is the class properties for updating campaign.
      • CampaignName
      • Subject
      • FromName
      • ReplyTo
      • From
      • ListID
      • TemplateContent
      • CampaignID
  • Return: It returns json with success status.

Send / Schedule a Campaign:

  • https Post
https://api.clastic.com/v1/sendorschedulecampaign?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address.
    • Provide valid CampaignID which will be sent or scheduled.
    • Provide ActionType which must be ony “Send” or “Schedule”.
    • If ActionType is “Send” then no need to pass the values for ScheduleDate and ScheduleTime.
    • If ActionType is “Schedule” then need to pass values for ScheduleDate and ScheduleTime.
    • Provide the ScheduleDate (If ActionType is “Schedule”) in “MM/DD/YYYY” format.
    • Provide the ScheduleTime (If ActionType is “Schedule”) in “HH:MM” format.
    • Provide the IncludeSignature if you want to add signature – will add signature automatically while sending an campaign.
  • Limitations:
    • Email address is mandatory.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • Given below is the class properties for updating campaign.
      • ActionType (String-Send or Schedule)
      • ScheduleDate (String in MM/DD/YYYY format-If ActionType is Schedule)
      • ScheduleTime (String in HH:MM format-If ActionType is Schedule)
      • IncludeSignature (Boolean-true or false to auto add signature)
      • CampiagnID(Integer)
  • Return: It returns json with success status and message.

Get Personalize Tags:

  • https Post
https://api.clastic.com/v1/getpersonalizetag
  • Limitations:
    • No limitations.
  • Required Fields:
    • No required fields.
  • Return: It returns the list of json format with following given details.
    • TagName (String)
    • TagValue (String)

Create a Sender Address:

  • https Post
https://api.clastic.com/v1/AddSenderAddress?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and sender address parameter(emailType,UserEmail)
    • you will get a message as “Email added successfully” with status “Success”
  • Limitations:
    • Email address and emailType fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
    • Email type field will accept values ‘from’/’reply’/’both’ only.
  • Required Fields:
    • User Email address (String)
    • EmailType (string)

Get a Sender Address:

  • https Post
https://api.clastic.com/v1/GetSenderAddress?userEmail={Registered email address}&emailType={from/reply/both}
  • How to use ?
    • Provide valid registered Email address and EmailType.
    • It will return all sender address by specified emailType.
  • Limitations:
    • Email address and emailType fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
    • Email type field will accept values ‘from’/’reply’/’both’ only.
  • Required Fields:
    • User Email address (String)
    • EmailType (string)

Get a Campaign Report Summary:

  • https Post
https://api.clastic.com/v1/GetReportSummary?userEmail={Registered email address}&campaignid={value}
  • How to use ?
    • Provide valid registered Email address and CampaignId.
    • It will return report summary details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • campaignid (Integer)

Export Open Report:

  • https Post
https://api.clastic.com/v1/ExportOpenDetails?userEmail={Registered email address}&campaignid={value}
  • How to use ?
    • Provide valid registered Email address and CampaignId.
    • It will return all the opened contact details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • campaignid (Integer)

Export Click Report:

  • https Post
https://api.clastic.com/v1/ExportClickDetails?userEmail={Registered email address}&campaignid={value}
  • How to use ?
    • Provide valid registered Email address and CampaignId.
    • It will return all the clicked contact details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • campaignid (Integer)

Export Unsubscribe Report:

  • https Post
https://api.clastic.com/v1/ExportUnsubscribeDetails?userEmail={Registered email address}&campaignid={value}
  • How to use ?
    • Provide valid registered Email address and CampaignId.
    • It will return all the unsubscribed contact details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • campaignid (Integer)

Export Share Report:

  • https Post
https://api.clastic.com/v1/ExportShareDetails?userEmail={Registered email address}&campaignid={value}
  • How to use ?
    • Provide valid registered Email address and CampaignId.
    • It will return all the shared contact details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • campaignid (Integer)

Export Bounce Report:

  • https Post
https://api.clastic.com/v1/ExportBounceDetails?userEmail={Registered email address}&campaignid={value}&Bouncetype={hard/soft}
  • How to use ?
    • Provide valid registered Email address,BounceType and CampaignId.
    • It will return all the shared contact details.
  • Limitations:
    • Email address and campaignid fileds are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
    • Bounce Type filed will accept only ‘hard’ or ‘soft’
  • Required Fields:
    • User Email address (String)
    • BounceType (String)
    • campaignid (Integer)

Get Open Details:

  • https Post
https://api.clastic.com/v1/GetOpenDetails?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and Report parameters(CampaignID,Rowstart,Rowend).
    • It will return all opened contacts details form Rowstart to Rowend .
  • Limitations:
    • Email address,CampaignID,Rowstart and Rowend fields are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • CampaignID (Integer)
    • Rowstart (Integer)
    • Rowend (Integer)

Get Unsubscribe Details:

  • https Post
https://api.clastic.com/v1/GetOpenDetails?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and Report parameters(CampaignID,Rowstart,Rowend).
    • It will return all opened contacts details form Rowstart to Rowend .
  • Limitations:
    • Email address,CampaignID,Rowstart and Rowend fields are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • CampaignID (Integer)
    • Rowstart (Integer)
    • Rowend (Integer)

Get a Campaign Share/Forward Details:

  • https Post
https://api.clastic.com/v1/GetShareDetails?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and Report parameters(CampaignID,Rowstart,Rowend).
    • It will return all shared contacts details form Rowstart to Rowend .
  • Limitations:
    • Email address,CampaignID,Rowstart and Rowend fields are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • CampaignID (Integer)
    • Rowstart (Integer)
    • Rowend (Integer)

Get Bounce Details:

  • https Post
https://api.clastic.com/v1/GetBounceDetails?userEmail={Registered email address}
  • How to use ?
    • Provide valid registered Email address and Report parameters(CampaignID,Rowstart,Rowend).
    • It will return all bounced contacts details form Rowstart to Rowend.
  • Limitations:
    • Email address,CampaignID,Rowstart and Rowend fields are mandatory.
    • If these fields are empty it will throws an exception.
    • If not providing a registered Email address API show status as “User doesn’t exist”
  • Required Fields:
    • User Email address (String)
    • CampaignID (Integer)
    • Rowstart (Integer)
    • Rowend (Integer)

Creating a new List


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string url2 " https://api.clastic.com /v1/CampaignerAPI/CreateList?UserEmail= 
{Registered email address}&ListName={list name}";
object result2 string.Empty;
try {
    using (var client2 new WebClient()) {
        ListGlobalData lst new List<GlobalData>();
        for (int i 0; i < 5;i++) {
            lst.Add(new GlobalData() { emailaddress  "umesh.bharati" + 
              i.ToString() +  "@stategicmail.co.in" });
        } 
        // Set the header so it knows we are sending JSON. 
      client2.Headers[ httpsRequestHeader.ContentType] = 
      "application/json"; 
      client2.Headers.Add("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON 
      string serialisedData = JsonConvert.SerializeObject(lst);
      // Make the request 
      var responseapi = client2.UploadString(url2, serialisedData);
        // Deserialise the response into a GUID 
      result2 =  JsonConvert.DeserializeObject(responseapi);
    }
}
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and
    pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Validating a List


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ValidateList?listId={ListID}&userEmail= 
{Registered email address}";
            object result2 string.Empty;
            try {
           WebRequest webRequest WebRequest.Create(url2);
      webRequest.Headers.Add( "X-ApiKey", "API_ID:API_Key");
         webRequest.Timeout 60000;
      WebResponse response webRequest.GetResponse();
            StreamReader streamReader new 
           StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
  }
  catch (WebException exception) {
    string responseText;
    if (exception.Response ! null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! null) {
            using (var reader new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get/Retrieve Validate Summary for a List


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/GetListValidateSummary?listId={ListID}
&userEmail={Registered email address}";
      object result2 string.Empty;
    try {
  WebRequest webRequest WebRequest.Create(url2);
   webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
 webRequest.Timeout 60000;
   WebResponse response webRequest.GetResponse();
   StreamReader streamReader new 
   StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
}
catch ( WebException exception) {
    string responseText;
    if (exception.Response ! null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! null) {
            using (var reader new  StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get / Retireve All List(s)


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
 string url2 "https://api.clastic.com/v1/GetAllList?PageNumber=1&userEmail= 
{Registered email address}&RecPerPage=10";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout 60000;
    WebResponse response webRequest.GetResponse();
    StreamReaderstreamReader new 
  StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
    }
  catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream !=  null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Delete a List


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string apiURL "https://api.clastic.com/v1/DeleteList?listId={List
 id}&userEmail={Registered email address}";
try 
{
        WebRequest webRequest = WebRequest.Create(apiURL);
       webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
      WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new 
       StreamReader(response.GetResponseStream());
      String responseData streamReader.ReadToEnd();
       JavaScriptSerializer json = new JavaScriptSerializer();
       var data2 json.DeserializeObject(responseData);
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }  } 
          }  
       }
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Download a List


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string apiURL "https://api.clastic.com/v1/DownloadList?listId=
{List ID}&userEmail={Registered email address}";
try 
 {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
       webRequest.Timeout = 12340000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new 
     StreamReader(response.GetResponseStream());
      String responseData streamReader.ReadToEnd();
       JavaScriptSerializer json = new JavaScriptSerializer();
       json.MaxJsonLength = Int32.MaxValue;
       ListYourListClass lst =
     json.Deserialize>(responseData);
}
catch (WebException exception) {
    string responseText; if (exception.Response ! = null) {
        var responseStream = exception.Response.GetResponseStream(); if (responseStream ! = null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
                }  }    } 
            }      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Create a Campaign


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
      string url2 "https://api.clastic.com/v1/
CreateCampaign?userEmail={Registered email address}";
try {
    using (var client2 = new WebClient()) {
        CampaignCreationClass objCampaignCreationClass = new CampaignCreationClass() {
            CampaignName ="UmeshFromAPI10", Subject = "Diwali Offer10", 
          FromName = "Umesh10", ReplyTo = "fromstrat@gmail.com", 
          From = "s.manu@strategicmail.co.in", ListID = "5897", TemplateContent = 
          @"Your Email (Template) Content"
        }
        ; // Set the header so it knows we are sending JSON. 
      client2.Headers[httpsRequestHeader.ContentType] = "application/json";
      client2.Headers.Add("X-ApiKey", " API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` string serialisedData = 
      JsonConvert.SerializeObject(objCampaignCreationClass); 
      // Make the request var responseapi = client2.UploadString(url2, serialisedData);
      // Deserialise the response .  var result2 = 
      JsonConvert.DeserializeObject(responseapi); } } catch (WebException exception) { string responseText;
        if (exception.Response ! = null) {
            var responseStream exception.Response.GetResponseStream(); if (responseStream ! = null) {
                using (var reader new StreamReader(responseStream)) {
                    responseText reader.ReadToEnd(); }
            }
        }
    }
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Campaign Details


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
      string url2 "https://api.clastic.com/v1/GetCampaign?
userEmail= API_ID:API_Key &CampaignID={campaignID}";
try {
    WebRequest webRequest =  WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout  Int32.MaxValue;
     WebResponse response = webRequest.GetResponse();
     StreamReader streamReader = new  StreamReader(response.GetResponseStream());
     String responseData streamReader.ReadToEnd();
	 //First way to get deserialized data. var result = 
	 json.DeserializeObject(responseData);
	  //Second way to get deserialized data. CampaignCreationClass obj1 = 
	  json.Deserialize(responseData); 
	  //Third way to get deserialized data. CampaignCreationClass obj2 = 
	  CampaignCreationClass)json.Deserialize(responseData, 
	  typeof(CampaignCreationClass)); } catch (WebException exception) 
	  { string responseText; if (exception.Response != null) 
	  { var responseStream = exception.Response.GetResponseStream(); 
	  if (responseStream != null) { using (var reader = new StreamReader(responseStream)) 
	  { //Here you will get validation error. responseText = reader.ReadToEnd(); 
	          } 
	       } 
	     } 
	  }
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Update a Campaign


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/UpdateCampaign?userEmail={Registered email address}";
try {
    using (var client2 new WebClient()) {
        CampaignCreationClass objCampaignCreationClass new CampaignCreationClass() {
            CampaignName = "This is modified campaign name", Subject = 
          "This is modified Subject", FromName = "This is modified FromName", 
          ReplyTo = "This is modified ReplyTo", From = "This is modified From", 
          ListID "1,2,3,4,5", //ListID separated by commma. TemplateContent =
          @"Your Email (Template) Content" }; 
      // Set the header so it knows we are sending JSON. 
      client2.Headers[httpsRequestHeader.ContentType] = "application/json"; 
      client2.Headers.Add("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` string serialisedData = 
      JsonConvert.SerializeObject(objCampaignCreationClass); 
      // Make the request var responseapi = client2.UploadString(url2, serialisedData); 
      // Deserialise the response . var result2 = JsonConvert.DeserializeObject(responseapi); 
    } } catch (WebException exception) {string responseText;
            if (exception.Response ! null) {
                var responseStream exception.Response.GetResponseStream();
                if (responseStream ! =  null) {
    using (var reader new StreamReader(responseStream)) responseText reader.ReadToEnd();
                    }
                }
            }
        }      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Send / Schedule a Campaign


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
      string url2 "https://api.clastic.com/v1/
SendOrScheduleCampaign?userEmail={Registered email address}";
try {
    using (var client2 new WebClient()) {
        SendSchedule objCampaignCreationClass new SendSchedule() {
            CampaignID 1, ActionType "Send", //Send or Schedule only. 
          IncludeSignature = true,//True or false. ScheduleDate="11/09/2015",
          //If ActionType is "Schedule". ScheduleTime = "23:23"
          //If ActionType is "Schedule". }; 
      // Set the header so it knows we are sending JSON.client2.Headers
      [httpsRequestHeader.ContentType] = "application/json";
      client2.Headers.Add("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON string serialisedData = 
      JsonConvert.SerializeObject(objCampaignCreationClass); 
      // Make the request var responseapi = client2.UploadString(url2, serialisedData); 
      // Deserialise the response into a GUID var result = 
      JsonConvert.DeserializeObject(responseapi); } } catch 
(WebException exception) { string responseText;
            if (exception.Response ! null) {
    var responseStream exception.Response.GetResponseStream();if (responseStream ! null) {
   using (var reader new StreamReader(responseStream)) { responseText reader.ReadToEnd();
                    }
                  }
                }
             }
      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get Personalize Tag


  1. Add web form to the project named WebReqCreateList.aspx
  2. In WebReqCreateList.aspx place following code
  3. In WebReqCreateList.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/GetPersonalizeTag";
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout 12340000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
    JavaScriptSerializer json new JavaScriptSerializer();
    List lst json.Deserialize>(responseData);
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! null) {
            using (var reader new = StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Add a sender email Address


  1. Add web form to the project named WebReqAddSender.aspx
  2. In WebReqAddSender.aspx place following code
  3. In WebReqAddSender.aspx.cs place following code
 
string url "https://api.clastic.com/v1/AddSenderAddress?userEmail=
{Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        senderAddress vf = new Consume.senderAddress() {
            EmailType="both", UserEmail="test1@test.com"
        }
        ; // Set the header so it knows we are sending JSON.
      client.Headers[httpsRequestHeader.
      ContentType] = "application/json"; 
      client.Headers.Add(("X-ApiKey", "API_ID:API_Key"); 
            // Serialise the data we are sending in to JSON` 
        string serialisedData = 
          JsonConvert.SerializeObject(repParam); 
      // Make the request var responseapi = 
                 client2.UploadString(url2, serialisedData);
      // Deserialise the response into a GUID result = 
          JsonConvert.DeserializeObject(responseapi); 
    } 
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Sender address


  1. Add web form to the project named WebReqSenderaddress.aspx
  2. In WebReqSenderaddress.aspx place following code
  3. In WebReqSenderaddress.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/GetSenderAddress ?
emailType={EmailType}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout 60000;
     WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
}
 catch ( WebException exception) {
    string responseText;
     if (exception.Response ! =  null) {
        var responseStream exception.Response.GetResponseStream();
         if (responseStream ! null) {
             using ( var reader new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Report Summary


  1. Add web form to the project named WebReqReportSummary.aspx
  2. In WebReqReportSummary.aspx place following code
  3. In WebReqReportSummary.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/GetReportSummary?camapignid=
{CampaignID}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
     WebResponse response = webRequest.GetResponse();
     StreamReader streamReader new StreamReader(response.GetResponseStream());
     String responseData streamReader.ReadToEnd();
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Campaign Open Details


  1. Add web form to the project named WebReqGetOpens.aspx
  2. In WebReqGetOpens.aspx place following code
  3. In WebReqGetOpens.aspx.cs place following code
 
string url "https://api.clastic.com/v1/
GetBounceDetails?userEmail={Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        ReportParams repParam = new Consume.ReportParams() {
            CampaignID {
                Campaign id
            }
            ,
            Rowstart 1,
            Rowend 30
        }
        ; // Set the header so it knows we are sending JSON. 
      client.Headers[httpsRequestHeader.ContentType] = "application/json";
      client.Headers.Add(("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` string serialisedData = 
      JsonConvert.SerializeObject(repParam); 
      // Make the request var responseapi = 
      client2.UploadString(url2, serialisedData);
      // Deserialise the response into a GUID result = 
      JsonConvert.DeserializeObject(responseapi); 
    } 
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Campaign Click Details


  1. Add web form to the project named WebReqGetClick.aspx
  2. In WebReqGetClick.aspx place following code
  3. In WebReqGetClick.aspx.cs place following code
 
string url "https://api.clastic.com/v1/GetClickDetails?
userEmail={Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        ReportParams repParam new Consume.ReportParams() {
            CampaignID {
                campaign id
            }
            ,
            Rowstart 1,
            Rowend 30
        }
        ; // Set the header so it knows we are sending JSON. 
      client.Headers[httpsRequestHeader.ContentType] = 
      "application/json"; client.Headers.Add(("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` string serialisedData = 
      JsonConvert.SerializeObject(repParam); 
      // Make the request var responseapi = 
      client2.UploadString(url2, serialisedData); 
      // Deserialise the response into a GUID result = 
      JsonConvert.DeserializeObject(responseapi);
    } 
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Campaign unsubscribe Details


  1. Add web form to the project named WebReqGetUnsub.aspx
  2. In WebReqGetUnsub.aspx place following code
  3. In WebReqGetUnsub.aspx.cs place following code
 
string url "https://api.clastic.com/v1/
GetUnsubscribeDetails?userEmail={Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        ReportParams repParam  = new Consume.ReportParams() {
            CampaignID {
                campaignid
            }
            ,
            Rowstart 1,
            Rowend 30
        }
        ; // Set the header so it knows we are sending JSON. 
      client.Headers[httpsRequestHeader.ContentType] = 
      "application/json"; client.Headers.Add(("X-ApiKey", "API_ID:API_Key");
      // Serialise the data we are sending in to JSON` string serialisedData =
      JsonConvert.SerializeObject(repParam);
      // Make the request var responseapi = 
      client2.UploadString(url2, serialisedData);
      // Deserialise the response into a GUID result = 
      JsonConvert.DeserializeObject(responseapi); 
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get Share Details


  1. Add web form to the project named WebReqGetShare.aspx
  2. In WebReqGetShare.aspx place following code
  3. In WebReqGetShare.aspx.cs place following code
 
string url "https://api.clastic.com/v1/GetShareDetails?
userEmail={Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        ReportParams repParam new Consume.ReportParams() {
            CampaignID {
                campaignID
            }
            ,
            Rowstart 1,
            Rowend 30
        }
        ; // Set the header so it knows we are sending JSON. c
      lient.Headers[httpsRequestHeader.ContentType] = 
      "application/json"; client.Headers.Add(("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` 
      string serialisedData = JsonConvert.SerializeObject(repParam); 
      // Make the request var responseapi = 
      client2.UploadString(url2, serialisedData); 
      // Deserialise the response into a GUID result = 
      JsonConvert.DeserializeObject(responseapi);
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Get a Campaign Bounce Details


  1. Add web form to the project named WebReqGetBounce.aspx
  2. In WebReqGetBounce.aspx place following code
  3. In WebReqGetBounce.aspx.cs place following code
 
string url "https://api.clastic.com/v1/
GetBounceDetails?userEmail={Registered email address}";
object result string.Empty;
try {
    using (var client = new WebClient()) {
        ReportParams repParam new Consume.ReportParams() {
            CampaignID {
                campaignID
            }
            ,
            Rowstart 1,
            Rowend 30
        }
        ; // Set the header so it knows we are sending JSON. 
      client.Headers[httpsRequestHeader.ContentType] = 
      "application/json"; client.Headers.Add(("X-ApiKey", "API_ID:API_Key"); 
      // Serialise the data we are sending in to JSON` string serialisedData = J
      sonConvert.SerializeObject(repParam); 
      // Make the request var responsi = 
      client2.UploadString(url2, serialisedData); 
      // Deserialise the response into a GUID result = 
      JsonConvert.DeserializeObject(responseapi); 
    } 
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Export open details for a campaign


  1. Add web form to the project named WebReqOpenExport.aspx
  2. In WebReqOpenExport.aspx place following code
  3. In WebReqOpenExport.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ ExportOpenDetails?camapignid
={campaign id}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData = streamReader.ReadToEnd();
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Export click details for a campaign


  1. Add web form to the project named WebReqClickExport.aspx
  2. In WebReqClickExport.aspx place following code
  3. In WebReqClickExport.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ ExportClickDetails?
camapignid={campaign id}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
    WebResponse response webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
}
catch (WebException exception) {
    tring responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Export unsubscribe details for a campaign


  1. Add web form to the project named WebReqUnsubExport.aspx
  2. In WebReqUnsubExport.aspx place following code
  3. In WebReqUnsubExport.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ExportUnsubscribeDetails?
camapignid={campaign id}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData = streamReader.ReadToEnd();
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Export share details for a campaign


  1. Add web form to the project named WebReqShareExport.aspx
  2. In WebReqShareExport.aspx place following code
  3. In WebReqShareExport.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ExportShareDetails?
camapignid={campaign id}&userEmail={Registered email address}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData = streamReader.ReadToEnd();
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

Export bounce details for a campaign


  1. Add web form to the project named WebReqBounceExport.aspx
  2. In WebReqBounceExport.aspx place following code
  3. In WebReqBounceExport.aspx.cs place following code
 
string url2 "https://api.clastic.com/v1/ ExportBounceDetails?
camapignid={campaign id}&userEmail={Registered email address}&bounce={bounce}";
object result2 string.Empty;
try {
    WebRequest webRequest = WebRequest.Create(url2);
    webRequest.Headers.Add("X-ApiKey", "API_ID:API_Key");
    webRequest.Timeout = 60000;
    WebResponse response = webRequest.GetResponse();
    StreamReader streamReader = new StreamReader(response.GetResponseStream());
    String responseData streamReader.ReadToEnd();
}
catch (WebException exception) {
    string responseText;
    if (exception.Response ! = null) {
        var responseStream exception.Response.GetResponseStream();
        if (responseStream ! = null) {
            using (var reader = new StreamReader(responseStream)) {
                responseText reader.ReadToEnd();
            }
        }
    }
}      
  1. Above aspx.cs code place a URL in which https request for Create List for User is hosted and pass Registered User Email address and Listname as a params.
  2. Replace User Email address, ListName in the URL.
  3. Run the application and make sure that there are no build errors.
  4. Keep the break point near “var responseapi” to check for API response.

This API documentation is provided by Clastic. You can download and use this template for free. If you have used this template, please pay the developer's effort by Tweeting, sharing on Facebook, social mention or with a linkback. Enjoy! :)