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.
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:
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 API | Description | How to Use? |
|---|---|---|
| Create List | It 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 List | It returns the summary of validated list. | Need Registered User email address, listId returned from createlist method. |
| Get List Validate Summary | It validates all the contacts of a list. | Need Registered User email address, listId returned from createlist method. |
| Get All List | It returns all the list with details. | Need Registered User email address, page number and page per records for pagination. |
| Delete list | It deletes the list. | Need Registered User email address, listId returned from createlist method. |
| Download List | It downloads all contacts in the list. | Need Registered User email address, listId returned from createlist method. |
| Create campaign | Its returns all details of a campaign | Need Registered User email address, CampaignID returnedfrom CreateCampaign method. |
| Get Campaign | It downloads all contacts in the list. | Need Registered User email address, listId returned from createlist method. |
| Update Campaign | It updates all the details of a campaign | Need Registered User email address and campaign details. |
| Send Or Schedule Campaign | It send/schedule the campaign | Need Registered User email address and send/schedule options.. |
| Add Sender Address | It adds sender address(from/reply email) | Need Registered User email address, senderemail and emailtype |
| Get Sender Address | It returns sender address(from/reply email) by specified emailtype | Need Registered User email address and emailtype |
| Get Report Summary | It returns report summary details by campaignid | Need Registered User email address and campaignid |
| Export Open Details | It returns all opened contact details by campaignid | Need Registered User email address and campaignid |
| Export Click Details | It returns all clicked contact details by campaignid | Need Registered User email address and campaignid |
| Export Unsubscribe Details | It returns all unsubscribed contact details by campaignid | Need Registered User email address and campaignid |
| Export Shared Details | It returns all shared contact details by campaignid | Need Registered User email address and campaignid. |
| Export Bounce Details | It returns all bounced contact details by campaignid | Need Registered User email address ,bouncetype and campaignid |
| Get Open Details | It returns all opened contact details from specified startvalue to end value by campaignid | Need Registered User email address, campaignid ,rowstart and rowend |
| Get Click Details | It returns all clicked contact details from specified startvalue to end value by campaignid | Need Registered User email address, campaignid ,rowstart and rowend |
| Get Unsubscribe Details | It returns all unsubscribed contact details from specified startvalue to end value by campaignid | Need Registered User email address, campaignid ,rowstart and rowend |
| Get Share Details | It returns all shared contact details from specified startvalue to end value by campaignid | Need Registered User email address, campaignid ,rowstart and rowend |
| Get Bounce Details | It returns all bounced contact details from specified startvalue to end value by campaignid | Need Registered User email address, campaignid ,rowstart and rowend |
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.
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:
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.
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.
Create List
https://api.clastic.com/v1/CreateList?UserEmail{Registered email address}&ListName={list name}
Get List Validation Summary:
https://api.clastic.com/v1/GetListValidateSummary?listId={listid}&userEmail={Registered email address}
Get / Retireve All List:
https://api.clastic.com/v1/GetAllList?PageNumber={value}&RecPerPage={value}&userEmail={Registered email address}
Delete a List:
https://api.clastic.com/v1/DeleteList?listId={value}&userEmail={registered email address}
Download a List:
https://api.clastic.com/v1/DownloadList?listId={value}&userEmail={Registered email address}
Create a Campaign:
https://api.clastic.com/v1/createcampaign?userEmail={Registered email address}
Get Campaign:
https://api.clastic.com/v1/getcampaign?campaignID={value}&userEmail={Registered email address}
Update Campaign:
https://api.clastic.com/v1/updatecampaign?userEmail={Registered email address}
Send / Schedule a Campaign:
https://api.clastic.com/v1/sendorschedulecampaign?userEmail={Registered email address}
Get Personalize Tags:
https://api.clastic.com/v1/getpersonalizetag
Create a Sender Address:
https://api.clastic.com/v1/AddSenderAddress?userEmail={Registered email address}
Get a Sender Address:
https://api.clastic.com/v1/GetSenderAddress?userEmail={Registered email address}&emailType={from/reply/both}
Get a Campaign Report Summary:
https://api.clastic.com/v1/GetReportSummary?userEmail={Registered email address}&campaignid={value}
Export Open Report:
https://api.clastic.com/v1/ExportOpenDetails?userEmail={Registered email address}&campaignid={value}
Export Click Report:
https://api.clastic.com/v1/ExportClickDetails?userEmail={Registered email address}&campaignid={value}
Export Unsubscribe Report:
https://api.clastic.com/v1/ExportUnsubscribeDetails?userEmail={Registered email address}&campaignid={value}
Export Share Report:
https://api.clastic.com/v1/ExportShareDetails?userEmail={Registered email address}&campaignid={value}
Export Bounce Report:
https://api.clastic.com/v1/ExportBounceDetails?userEmail={Registered email address}&campaignid={value}&Bouncetype={hard/soft}
Get Open Details:
https://api.clastic.com/v1/GetOpenDetails?userEmail={Registered email address}
Get Unsubscribe Details:
https://api.clastic.com/v1/GetOpenDetails?userEmail={Registered email address}
Get a Campaign Share/Forward Details:
https://api.clastic.com/v1/GetShareDetails?userEmail={Registered email address}
Get Bounce Details:
https://api.clastic.com/v1/GetBounceDetails?userEmail={Registered email address}
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); } }
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(); } } } }
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(); } } } }
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(); } } } }
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(); } } } }
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(); } } } }
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(); }
}
}
}
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();
}
}
}
}
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(); } } } }
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();
}
}
}
}
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(); Listlst 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(); } } } }
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); } }
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(); } } } }
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(); } } } }
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); } }
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); } }
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); } }
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); } }
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); } }
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(); } } } }
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(); } } } }
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(); } } } }
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(); } } } }
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(); } } } }