Manage Templates


1) Get Template List


https://secure.xwireless.net/api/v2/Template?ApiKey={ApiKey}&ClientId={ClientId}
 


Parameters :
Parameter Name Description Type
ApiKey ApiKey used for authentication purpose and pass this parameter in URL encoded format. String
ClientId ClientId used for authentication purpose and pass this parameter in URL encoded format. String
HEADERS :
Content-Typeapplication/json or application/xml
Typejson or xml
Jquery Api Call :
<script>
    $(function () {         
         $.ajax({
            type: "GET",
            url: "https://secure.xwireless.net/api/v2/Template?ApiKey={ApiKey}&ClientId={ClientId}",
            contentType: "application/json",
            dataType: 'json',
            success: function (response) {
                
            }
        });
    });
</script>
Json Response Xml Response
{
  "ErrorCode": 0,
  "ErrorDescription": "Success",
  "Data": [
    {
      "TemplateId": 138,
      "CompanyId": 121,
      "TemplateName": "test",
      "MessageTemplate": "test ##Field##",
      "IsApproved": false,
      "IsActive": true,
      "CreatededDate": "Mar 19, 2018",
      "ApprovedDate": "Mar 19, 2018",
    }
  ]
}
<ResponseModelOfListOfTemplate>
  <ErrorCode>0</ErrorCode>
  <ErrorDescription>Success</ErrorDescription>
  <Data>
    <Template>
      <TemplateId>138</TemplateId>
      <CompanyId>121</CompanyId>
      <TemplateName>test</TemplateName>
      <MessageTemplate>test ##Field##</MessageTemplate>
      <IsApproved>false</IsApproved>
      <IsActive>true</IsActive>
      <CreateDate>Mar 19, 2018</CreateDate>
      <ApprovedDate>Mar 19, 2018</ApprovedDate>
    </Template>
  </Data>
</ResponseModelOfListOfTemplate>

2) Create New Template


 https://secure.xwireless.net/api/v2/Template
 


Request Body :
JSON XML
{
  "TemplateName": "string",
  "MessageTemplate": "string",
  "ApiKey": "string",
  "ClientId": "string"
}
<?xml version="1.0"?>
<TemplateAPIModel>
  <TemplateName>string</TemplateName>
  <MessageTemplate>string</MessageTemplate>
  <ApiKey>string</ApiKey>
  <ClientId>string</ClientId>
</TemplateAPIModel>
Parameters :
Parameter Name Description Type
ApiKey ApiKey used for authentication purpose. String
ClientId ClientId used for authentication purpose. String
TemplateName Name of template String
MessageTemplate Template text. string
HEADERS :
Content-Typeapplication/json or application/xml
Typejson or xml
Jquery Api Call :
<script>   
    $(function () {
        var Jsondata = {
            'TemplateName': 'hello',
            'MessageTemplate': 'promotional',           
            'ApiKey': 'ApiKey',
            'ClientId': 'ClientId'
        };
        $.ajax({
            type: "POST",
            url: "https://secure.xwireless.net/api/v2/Template",
            contentType: "application/json",
            dataType: 'json',
            data: JSON.stringify(Jsondata),
            success: function (response) {                
            }
        });
    });

</script>
Json Response Xml Response
{
  "ErrorCode": 0,
  "ErrorDescription": "Success",
  "Data": "Template Added successfully."
}
<ResponseModelOfString>
    <ErrorCode>0</ErrorCode>
    <ErrorDescription>Success</ErrorDescription>
    <Data>Template Added successfully.</Data>
</ResponseModelOfString>

3) Update Template


 https://secure.xwireless.net/api/v2/Template?id={id}
 


Request Body :
JSON XML
{
  "TemplateName": "string",
  "MessageTemplate": "string",
  "ApiKey": "string",
  "ClientId": "string"
}
<?xml version="1.0"?>
<TemplateAPIModel>
  <TemplateName>string</TemplateName>
  <MessageTemplate>string</MessageTemplate>
  <ApiKey>string</ApiKey>
  <ClientId>string</ClientId>
</TemplateAPIModel>
Parameters :
Parameter Name Description Type
ApiKey ApiKey used for authentication purpose. String
ClientId ClientId used for authentication purpose. String
TemplateName Name of template String
MessageTemplate Template text. string
id id of template integer
HEADERS :
Content-Typeapplication/json or application/xml
Typejson or xml
Jquery Api Call :
<script>   
    $(function () {
       var Jsondata = {
            'TemplateName': 'hello',
            'MessageTemplate': 'promotional',           
            'ApiKey': 'ApiKey',
            'ClientId': 'ClientId'
        };
        $.ajax({
            type: "PUT",
            url: "https://secure.xwireless.net/api/v2/Template?id={Id}",
            contentType: "application/json",
            dataType: 'json',
            data: JSON.stringify(Jsondata),
            success: function (response) {                
            }
        });
    });

</script>
Json Response Xml Response
{
    "ErrorCode": 0,
    "ErrorDescription": "Success",
    "Data": "Template updated Successfully."
}
<ResponseModelOfString>
    <ErrorCode>0</ErrorCode>
    <ErrorDescription>Success</ErrorDescription>
    <Data>Template updated Successfully.</Data>
</ResponseModelOfString>

4) Delete Template


 https://secure.xwireless.net/api/v2/Template?ApiKey={ApiKey}&ClientId={ClientId}&id={Id}
 


Parameters :
Parameter Name Description Type
ApiKey ApiKey used for authentication purpose. String
ClientId ClientId used for authentication purpose. String
id Id of template. integer
HEADERS :
Content-Typeapplication/json or application/xml
Typejson or xml
Jquery Api Call :
<script>   
    $(function () {      
        $.ajax({
            type: "DELETE",
            url: "https://secure.xwireless.net/api/v2/Template?ApiKey={ApiKey}&ClientId={ClientId}&id={id}'",
            contentType: "application/json",
            dataType: 'json',
            data: JSON.stringify(Jsondata),
            success: function (response) {                
            }
        });
    });
</script>
Json Response Xml Response
{
    "ErrorCode": 0,
    "ErrorDescription": "Success",
    "Data": "Template deleted Successfully."
}
<ResponseModelOfString>
    <ErrorCode>0</ErrorCode>
    <ErrorDescription>Success</ErrorDescription>
    <Data>Template deleted Successfully.</Data>
</ResponseModelOfString>

Did you find this article useful?



  • Getting Started

    Before you can start using the X-Wireless API, you need to do the following: Create an Account with X-Wireless if you do not already have one Gene...

  • Get Credit Balance

    https://secure.xwireless.net/api/v2/Balance?ApiKey={ApiKey}&ClientId={ClientId}Parameters : Parameter Name Description Type Api...

  • Campaign

    1) Get Campaign Message Status https://secure.xwireless.net/api/v2/Campaign/Statistics?ApiKey={ApiKey}&ClientId={ClientId}&campaignId={c...

  • Manage Group

    1) Get Group List https://secure.xwireless.net/api/v2/Group?ApiKey={ApiKey}&ClientId={ClientId}   Parameters : Parameter Name ...

  • Manage Sender ID

    1) Get Sender Id List  https://secure.xwireless.net/api/v2/SenderId?ApiKey={ApiKey}&ClientId={ClientId}   Parameters : Par...