NAV
shell php java python nodejs ruby c#

Authentication

Each request made must include client authorisation in the header of the HTTP request. This will use basic HTTP access authentication.

The authorisation header is constructed by combining the username:password string and encoding it in Base64. This string is prefixed by the Authorization: Basic string.

For example, for the username username and password apiPassword, the resulting header would be:

Authorization: Basic dXNlcm5hbWU6YXBpUGFzc3dvcmQ=

Campaigns

SMS

Send SMS Message

POST https://dashboard.360nrs.com/api/rest/sms

curl -X POST 'https://dashboard.360nrs.com/api/rest/sms' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34666555444"],
  "from": "TEST",
  "message": "SMS text message"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/sms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34666555444"],
  "from": "TEST",
  "message": "SMS text message"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/sms");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34666555444\"], \"from\": \"TEST\", \"message\": \"SMS text message\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/sms',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34666555444"], "from": "TEST", "message": "SMS text message" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/sms"

payload = "{ \"to\": [\"34666555444\"], \"from\": \"TEST\", \"message\": \"SMS text message\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/sms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34666555444\"], \"from\": \"TEST\", \"message\": \"SMS text message\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/sms");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34666555444\"], \"from\": \"TEST\", \"message\": \"SMS text message\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 202 (ACCEPTED)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666555444",
      "id": "XXXXXXXXXXXXX",
      "parts": 1,
      "scheduledAt": null,
      "expiresAt": null
    }
  ]
}

HTTP Response Code 207 (MULTI-STATUS)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666555444",
      "id": "XXXXXXXXXXXXX",
      "parts": 1,
      "scheduledAt": null,
      "expiresAt": null
    },
    {
      "accepted": false,
      "to": "34",
      "error": {
        "code": 102,
        "description": "No valid recipients"
      }
    }
  ]
}

Error response (HTTP 400)

{
  "error": {
    "code": 102,
    "description": "No valid recipients"
  }
}

Parameters

Parameter Type Mandatory Description
message string Yes Text of message. At most, there can be 160 characters if it is not specified that the message is multi-part (see parts parameter). The text must be encoded in UTF-8.
to array Yes Mobile phone number to receive message. Must include the prefix (e.g. in Spain 34666666666). This field allows you to specify multiple recipients.
from string Yes Sender text, this label will consist of 15 numbers or 11 alphanumeric characters.
encoding string No Possible values are 'gsm', 'gsm-pt' and 'utf-16'. The value gsm for normal mailings with GSM7 coding and 160 characters per message, and the value utf-16 for UCS2 (UTF16) coding and 70 characters per message. If not specified, the default value is gsm.
scheduleDate string No Date of message sent in UTC format. If you need to send scheduled messages, the delivery date can be specified by indicating the date in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate mailings, this parameter does not have to be specified.
expirationDate string No Message expiration date in UTC. Format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00).
parts integer No Indicates the maximum number of parts into which the scheduled message will be divided. This variable is set to 1 by default, so if it is not specified and a message over 160 characters for gsm encoding is sent, the message will fail. Keep in mind that concatenated messages may only be 153 characters per part in gsm and 67 characters per part in utf-16 and each part is charged as one message. The server will only use the minimum necessary parts for sending the text even if the specified number of parts is higher than necessary. If the number of parts is less than that required for sending the text, the message will fail with error 105. The maximum number of parts allowed is 8.
notificationUrl string No URL to receive delivery notifications.
trans integer No Possible values are 1 and 0. With value 0, the server does not change any character in the message, as this is the default value. With value 1, the server modifies the common invalid characters in GSM7 to valid characters with the following translation table: 'á' => 'a', 'í'=>'i', 'ó'=>'o', 'ú'=>'u', 'ç'=>'Ç', 'Á'=>'A', 'Í'=>'I', 'Ó'=>'O', 'Ú'=>'U', 'À'=>'A', 'È'=>'E', 'Ì'=>'I', 'Ò'=>'O', 'Ù'=>'U', 'º' => '', 'ª' => '', 'Õ' => 'O', 'õ' => 'o', 'â' => 'a', 'ê' => 'e', 'î'=>'i', 'ô'=>'o', 'û'=>'u', ' '=>'A', 'Ê'=>'E', 'Î'=>'I', 'Ô'=>'O', 'Û'=>'U', 'ã' => 'a', 'Ã' => 'A'.
campaignName string No Campaign name. If specified, a campaign will be created with the name indicated in the dashboard and which will contain the mailing statistics. If a campaign with this name already exists, the delivery statistics will be added to the existing campaign.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. The tags can be used to filter the statistics in the dashboard.
certified boolean No If it is specified as true, the message will be sent as certified.
Certified messages have additional cost
sub array No array with substitution variables that will be applied to the message.
splitParts boolean No For messages that exceed the maximum SMS length, the server will split the message into multiple SMS instead of using concatenated SMS. The default value is false.
flash boolean No Flash SMS is a message that appears directly on the device screen. Depending on the model and operating system it is possible to store it in the inbox and send concatenated messages.
availableTimes array No It indicates the times in which the SMS will be sent. Json objects are defined in the form:

[{"day": 1, "from": "09:00", "to": "21:00"}]

day: a day of the range between Monday to Sunday is indicated, it must be a number between 1 and 7. Optional: If not specified, the range will apply to all days of the week.
from: time that defines the start of the time range in UTC 24 hour format.
to: time that defines the end of the time range in UTC 24 hour format.

Substitution variables

When using the sub parameter, the array must contain as many items as the send recipients, using the following format:

{
  "from": "TEST",
  "to": ["34666555444", "34666555333"],
  "message": "Hello {name}",
  "sub": [
    {"name": "first contact name"},
    {"name": "second contact name"}
  ]
}

Custom variables can be indicated in the message body. These variables will be replaced by the contact´s custom variables or by the variables indicated in the sub parameter.

Custom fields filters

It is possible to add the following filters to custom variables.

Filter Description Example Result
lower Return lowercase text. {name|lower} my name
upper Return text in uppercase. {name|upper} MY NAME
capitalize Return the text with the first letter of the first word in uppercase. {name|capitalize} My name
capitalizeAll Return the text with the first letter of each word in uppercase. {name|capitalizeAll} My Name
formatDotComma Returns the number with a dot as thousands separator and comma as decimal separator. {number|formatDotComma} 1.234,56
formatCommaDot Returns the number with a comma as thousands separator and dot as decimal separator. {number|formatCommaDot} 1,234.56
shorten Returns a shortened url. It must be a valid url. {url|shorten} https://nrs.so/xxxxxx

Delivery notifications

If you wish to receive delivery notifications in real time, you must specify the variable notificationUrl with the URL of the client where you want mailing status to be notified.

The operation involves specifying the URL where you want to make a request to our server for each HTTP request when a notification from the operator is received. To do this, the client must have an HTTP server capable of receiving such notifications.

Our server will send the variables using the GET method as the client wants. To do that in the URL that you send us, you have to write the variable name followed by an escape character that will contain the value; escape characters have the form of the % character followed by a letter. This is an example URL:

http://mi.server.com/notifica.php?remitente=%p&tel=%P&estado=%d

These are the defined escape characters:

The %d value will return the final mailing status to us, with the possible values being:

To better explain the process, below is an example of the SMS message and its delivery notification.

First, we send the SMS with the notificationUrl variable to indicate the URL where we want to receive the delivery notification. We will add our mailing identifier to this URL to identify it unambiguously when we receive it. The final URL for the notification would be:

http://mi.server.com/notifica.php?idenvio=7584remitente=%p&tel=%P&estado=%d

SMS information by message id

GET https://dashboard.360nrs.com/api/rest/sms/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/sms/<ID>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/sms/<ID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/sms/<ID>");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/sms/<ID>',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/sms/<ID>"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/sms/<ID>")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/sms/<ID>");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 200 (OK)

{
    "data": [
        {
            "id": "XXXXXXXXXXXXX",
            "from": "360NRS",
            "to": "34666555444",
            "message": "SMS text message",
            "campaignId": 123456,
            "sendingId": 234567,
            "isDelivered": true,
            "isClicked": false,
            "events": [
                {
                    "type": "sent",
                    "date": "2021-07-19T15:00:33+00:00",
                    "isMobile": false,
                    "browser": "",
                    "os": ""
                },
                {
                    "type": "delivered",
                    "date": "2021-07-19T15:00:33+00:00",
                    "isMobile": false,
                    "browser": "",
                    "os": ""
                }
            ],
            "customFields": {
                "email": "test@test.com",
                "phone": "34666555444",
                "name": "Name"
            },
            "links": {
                "self": "https://dashboard.360nrs.com/api/rest/sms/XXXXXXXXXXXXX"
            }
        }
    ]
}

Error response (HTTP 404)

{
    "error": {
        "code": 404,
        "description": "Resource not found"
    }
}
Parameter Type Mandatory Description
id string Yes Identifier of the message returned in the response of api/rest/sms in the id field. It is possible to specify multiple identifiers separated by commas.

Email

Send Email message

POST https://dashboard.360nrs.com/api/rest/mailing

curl -X POST 'https://dashboard.360nrs.com/api/rest/mailing' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "to": ["test@example.com"],
    "fromName": "Info",
    "fromEmail": "info@360nrs.com",
    "body": "<html><head><title>TEST</title></head><body><a href=\"https://example.com\">link</a></body></html>",
    "replyTo": "replyto@example.com",
    "subject": "TEST"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/mailing',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "to": ["test@example.com"],
    "fromName": "Info",
    "fromEmail": "info@360nrs.com",
    "body": "<html><head><title>TEST</title></head><body><a href=\"https://example.com\">link</a></body></html>",
    "replyTo": "replyto@example.com",
    "subject": "TEST"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/mailing");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"test@example.com\"], \"fromName\": \"Info\", \"fromEmail\": \"info@360nrs.com\", \"body\": \"<html><head><title>TEST</title></head><body><a href=\\\"https://example.com\\\">link</a></body></html>\", \"replyTo\": \"replyto@example.com\", \"subject\": \"TEST\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/mailing',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["test@example.com"], "fromName": "Info", "fromEmail": "info@360nrs.com", "body": "<html><head><title>TEST</title></head><body><a href=\"https://example.com\">link</a></body></html>", "replyTo": "replyto@example.com", "subject": "TEST" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/mailing"

payload = "{ \"to\": [\"test@example.com\"], \"fromName\": \"Info\", \"fromEmail\": \"info@360nrs.com\", \"body\": \"<html><head><title>TEST</title></head><body><a href=\\\"https://example.com\\\">link</a></body></html>\", \"replyTo\": \"replyto@example.com\", \"subject\": \"TEST\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/mailing")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"test@example.com\"], \"fromName\": \"Info\", \"fromEmail\": \"info@360nrs.com\", \"body\": \"<html><head><title>TEST</title></head><body><a href=\\\"https://example.com\\\">link</a></body></html>\", \"replyTo\": \"replyto@example.com\", \"subject\": \"TEST\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/mailing");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"test@example.com\"], \"fromName\": \"Info\", \"fromEmail\": \"info@360nrs.com\", \"body\": \"<html><head><title>TEST</title></head><body><a href=\\\"https://example.com\\\">link</a></body></html>\", \"replyTo\": \"replyto@example.com\", \"subject\": \"TEST\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 202 (ACCEPTED)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "test@example.com",
      "id": "XXXXXXXXXXXXX",
      "scheduledAt": null
    }
  ]
}

HTTP Response Code 207 (MULTI-STATUS)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "test@example.com",
      "id": "XXXXXXXXXXXXX",
      "scheduledAt": null
    },
    {
      "accepted": false,
      "to": "invalidEmail",
      "error": {
        "code": 102,
        "description": "No valid recipients"
      }
    }
  ]
}

Error response (HTTP 400)

{
  "error": {
    "code": 102,
    "description": "No valid recipients"
  }
}

Parameters

Parameter Type Mandatory Description
body string No Email body in HTML format and UTF-8 encoding. Required without templateId.
templateId integer No Template ID to send as the body of the email. Required without body.
to array Yes Email addresses of the sending consignees. This field allows you to specify multiple recipients.
fromEmail string Yes Sender email The indicated email address must be validated on the 360NRS platform..
subject string Yes Brief summary of the subject of the message.
fromName string No Name of sender of the sending.
replyTo string Yes Address for responding to the message.
scheduleDate string No Date message sent in UTC format. If you need to send scheduled messages, the send date can be specified by indicating the date in the following format YYYYmmddHHiiss (ej. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate mailings, this parameter does not have to be specified.
campaignName string No Campaign name. If specified, a campaign will be created with the name indicated in the dashboard and which will contain the mailing statistics. If a campaign with this name already exists, the delivery statistics will be added to the existing campaign.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. The tags can be used to filter the statistics in the dashboard.
sub array No array with substitution variables that will be applied to the message.
trackOpens boolean No Add a pixel to get opening statistics. The default value is true.
trackClicks boolean No Track the links to get click statistics. The default value is true.

Substitution variables

When using the sub parameter, the array must contain as many items as the send recipients, using the following format:

{
  "to": ["test@example.com", "test2@example.com"],
  "fromName": "Info",
  "fromEmail": "info@360nrs.com",
  "body": "<html><head><title>TEST</title></head><body>Hello {name}, <a href=\"https://example.com\">link</a></body></html>",
  "replyTo": "replyto@example.com",
  "subject": "TEST",
  "sub": [
    {"name": "first contact name"},
    {"name": "second contact name"}
  ]
}

Custom variables can be indicated in the message body. These variables will be replaced by the contact´s custom variables or by the variables indicated in the sub parameter.

Voice

Send Voice message

POST https://dashboard.360nrs.com/api/rest/voice

curl -X POST 'https://dashboard.360nrs.com/api/rest/voice' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34666666666"],
  "message": "Esto es un test de mensaje de voz",
  "gender": "F",
  "language": "es_ES"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/voice',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34666666666"],
  "message": "Esto es un test de mensaje de voz",
  "gender": "F",
  "language": "es_ES"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/voice");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34666666666\"], \"message\": \"Esto es un test de mensaje de voz\", \"gender\": \"F\", \"language\": \"es_ES\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/voice',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34666666666"], "message": "Esto es un test de mensaje de voz", "gender": "F", "language": "es_ES" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/voice"

payload = "{ \"to\": [\"34666666666\"], \"message\": \"Esto es un test de mensaje de voz\", \"gender\": \"F\", \"language\": \"es_ES\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/voice")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34666666666\"], \"message\": \"Esto es un test de mensaje de voz\", \"gender\": \"F\", \"language\": \"es_ES\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/voice");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34666666666\"], \"message\": \"Esto es un test de mensaje de voz\", \"gender\": \"F\", \"language\": \"es_ES\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 202 (ACCEPTED)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666666666",
      "id": "XXXXXXXXXXXXX",
      "scheduledAt": null,
      "expiresAt": null
    }
  ]
}

HTTP Response Code 207 (MULTI-STATUS)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666666666",
      "id": "XXXXXXXXXXXXX",
      "parts": 1,
      "scheduledAt": null,
      "expiresAt": null
    },
    {
      "accepted": false,
      "to": "34",
      "error": {
        "code": 102,
        "description": "No valid recipients"
      }
    }
  ]
}

Error response (HTTP 400)

{
  "error": {
    "code": 102,
    "description": "No valid recipients"
  }
}

Parameters

Parameter Type Required Description
message string Yes Message text. At most it can have 500 characters. The text must be encoded in UTF-8.
to array Yes Mobile phone number to receive message. Must include the prefix (e.g. in Spain 34666666666). This field allows you to specify multiple recipients.
language string Yes Language to convert the text; the options are:

'en_GB': English - United Kingdom,
'en_US': English - United States,
'es_ES': Spanish - España,
'es_US': Spanish - Latino,
'pt_PT': Portuguese - Portugal,
'pt_BR': Portuguese - Brazil,
'cmn_CN': Mandarin Chinese - China *,
'arb': Arab *,
'de_DE': German - Germany,
'fr_FR': French - France,
'it_IT': Italian - Italy,
'hi_IN': Indi - India *.

* Available only in female gender.
gender string Yes Gender of voice; the allowed values ​​are 'F' for a woman's voice and 'M' for a man's voice.
callers object No Object with the list of personalized senders by country to be used in the call. If the sender is not specified for a specific country, the default sender will be used. In order to st-up a customized sender, please contact the support department. Example:

{"ES": "6123456789", "PT": "6987654321"}
scheduleDate string No Date of message sent in UTC format. If you need to send scheduled messages, the delivery date can be specified by indicating the date in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate messages, this parameter does not have to be specified.
expirationDate string No To determine the latest date on which the call can be performed. After this date, the call will be cancelled. By specifying the period of validity, retries will be automatically attempted, making the call again if the recipient does not answer. The date should be in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20).
campaignName string No Campaign name. If specified, a campaign will be created with the name indicated in the dashboard and which will contain the mailing statistics. If a campaign with this name already exists, the mailing statistics will be added to the existing campaign.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. The tags can be used to filter the statistics in the dashboard.
sub array No array with substitution variables that will be applied to the message.

Substitution variables

Custom variables can be indicated in the message body. These variables will be replaced by the contact´s custom variables or by the variables indicated in the sub parameter. When using the sub parameter, the array must contain as many items as the send recipients.

Send Voice message with an audio file

POST https://dashboard.360nrs.com/api/rest/voiceAudio

curl -X POST 'https://dashboard.360nrs.com/api/rest/voiceAudio' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34666666666"],
  "audioUrl": "https://example.com/audio.mp3"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/voiceAudio',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34666666666"],
  "audioUrl": "https://example.com/audio.mp3"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/voiceAudio");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34666666666\"], \"audioUrl\": \"https://example.com/audio.mp3\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/voiceAudio',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34666666666"], "audioUrl": "https://example.com/audio.mp3" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/voiceAudio"

payload = "{ \"to\": [\"34666666666\"], \"audioUrl\": \"https://example.com/audio.mp3\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/voiceAudio")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34666666666\"], \"audioUrl\": \"https://example.com/audio.mp3\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/voiceAudio");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34666666666\"], \"audioUrl\": \"https://example.com/audio.mp3\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 202 (ACCEPTED)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666666666",
      "id": "XXXXXXXXXXXXX",
      "scheduledAt": null,
      "expiresAt": null
    }
  ]
}

Error response (HTTP 400)

{
  "error": {
    "code": 102,
    "description": "No valid recipients"
  }
}

Parameters

Parameter Type Required Description
to array Yes Mobile phone number to receive message. Must include the prefix (e.g. in Spain 34666666666). This field allows you to specify multiple recipients.
audioUrl string Yes URL of the audio to be sent. Example: https://example.com/audio.mp3
callers object No Object with the list of personalized senders by country to be used in the call. If the sender is not specified for a specific country, the default sender will be used. In order to st-up a customized sender, please contact the support department. Example:

{"ES": "6123456789", "PT": "6987654321"}
scheduleDate string No Date of message sent in UTC format. If you need to send scheduled messages, the delivery date can be specified by indicating the date in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate messages, this parameter does not have to be specified.
expirationDate string No To determine the latest date on which the call can be performed. After this date, the call will be cancelled. By specifying the period of validity, retries will be automatically attempted, making the call again if the recipient does not answer. The date should be in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20).
campaignName string No Campaign name. If specified, a campaign will be created with the name indicated in the dashboard and which will contain the mailing statistics. If a campaign with this name already exists, the mailing statistics will be added to the existing campaign.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. The tags can be used to filter the statistics in the dashboard.

Retry Policy

The voice system allows automatic retries if the recipient does not answer the call. This functionality does not generate additional costs, since only the calls that are answered by the recipient will be charged.

When the system detects that the call has not been answered, the call is repeated after 30 minutes. The time elapsed from the unanswered call to the retry time will vary depending on the existing queue, but it is always greater than 30 minutes. A maximum of 3 retries will be attempted after the first call.

To avoid retries at unwanted times, it is essential to specify the optional variable expirationDate in order to enable this functionality.

Voice Interactive

Send Voice Interactive message

POST https://dashboard.360nrs.com/api/rest/voice-interactive

Text to speech request

curl -X POST 'https://dashboard.360nrs.com/api/rest/voice-interactive' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34699999999"],
  "campaignName": "Llamadas de prueba",
  "menu": {
    "gender": "M",
    "language": "es_ES",
    "message": "Esto es un test de llamada interactiva",
    "type": "speech"
  }
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/voice-interactive',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34699999999"],
  "campaignName": "Llamadas de prueba",
  "menu": {
    "gender": "M",
    "language": "es_ES",
    "message": "Esto es un test de llamada interactiva",
    "type": "speech"
  }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/voice-interactive");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"gender\": \"M\", \"language\": \"es_ES\", \"message\": \"Esto es un test de llamada interactiva\", \"type\": \"speech\" } }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/voice-interactive',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34699999999"], "campaignName": "Llamadas de prueba", "menu": { "gender": "M", "language": "es_ES", "message": "Esto es un test de llamada interactiva", "type": "speech" } }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/voice-interactive"

payload = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"gender\": \"M\", \"language\": \"es_ES\", \"message\": \"Esto es un test de llamada interactiva\", \"type\": \"speech\" } }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/voice-interactive")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"gender\": \"M\", \"language\": \"es_ES\", \"message\": \"Esto es un test de llamada interactiva\", \"type\": \"speech\" } }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/voice-interactive");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"gender\": \"M\", \"language\": \"es_ES\", \"message\": \"Esto es un test de llamada interactiva\", \"type\": \"speech\" } }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Send audio request

curl -X POST 'https://dashboard.360nrs.com/api/rest/voice-interactive' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34699999999"],
  "campaignName": "Llamadas de prueba",
  "menu": {
    "url": "https://www.audio.com/audio.wav",
    "type": "audio"
  }
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/voice-interactive',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34699999999"],
  "campaignName": "Llamadas de prueba",
  "menu": {
    "url": "https://www.audio.com/audio.wav",
    "type": "audio"
  }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/voice-interactive");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"url\": \"https://www.audio.com/audio.wav\", \"type\": \"audio\" } }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/voice-interactive',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34699999999"], "campaignName": "Llamadas de prueba", "menu": { "url": "https://www.audio.com/audio.wav", "type": "audio" } }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/voice-interactive"

payload = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"url\": \"https://www.audio.com/audio.wav\", \"type\": \"audio\" } }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/voice-interactive")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"url\": \"https://www.audio.com/audio.wav\", \"type\": \"audio\" } }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/voice-interactive");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34699999999\"], \"campaignName\": \"Llamadas de prueba\", \"menu\": { \"url\": \"https://www.audio.com/audio.wav\", \"type\": \"audio\" } }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Complete request example

{
  "to": [
    "699999999"
  ],
  "campaignName": "Campaña de prueba",
  "menu": {
    "gender": "F",
    "language": "es_ES",
    "message": "Hola, elija una de las siguientes opciones: 1. Transferir con Comercial. 2. Valorar nuestra atención al cliente. 3. Agregar al Blacklist. 4. Repetir mensaje",
    "type": "speech",
    "menuOptions": [
      {
        "key": -1,
        "typeId": "Play",
        "data": {
          "gender": "M",
          "language": "es_ES",
          "message": "Ha elegido una opción incorrecta.",
          "type": "speech"
        }
      },
      {
        "key": 1,
        "typeId": "CallTransfer",
        "data": {
          "url": "http://www.audios.com/audio.wav",
          "type": "audio",
          "phone": "699999999",
          "phonePrefix": "34"
        }
      },
      {
        "key": 2,
        "typeId": "GetDataWhilePlaying",
        "data": {
          "gender": "M",
          "language": "es_ES",
          "message": "Puntúe del 1 al 5 nuestra atención al cliente.",
          "type": "speech"
        },
        "menu": {
          "gender": "M",
          "language": "es_ES",
          "message": "Puntúe del 1 al 5 nuestra atención al cliente.",
          "type": "speech",
          "menuOptions": [
            {
              "key": 1,
              "typeId": "Play",
              "data": {
                "gender": "M",
                "language": "es_ES",
                "message": "Gracias por valorar nuestra atención",
                "type": "speech"
              }
            },
            {
              "key": 2,
              "typeId": "Play",
              "data": {
                "gender": "M",
                "language": "es_ES",
                "message": "Gracias por valorar nuestra atención",
                "type": "speech"
              }
            },
            {
              "key": 3,
              "typeId": "Play",
              "data": {
                "gender": "M",
                "language": "es_ES",
                "message": "Gracias por valorar nuestra atención",
                "type": "speech"
              }
            },
            {
              "key": 4,
              "typeId": "Play",
              "data": {
                "gender": "M",
                "language": "es_ES",
                "message": "Gracias por valorar nuestra atención",
                "type": "speech"
              }
            },
            {
              "key": 5,
              "typeId": "Play",
              "data": {
                "gender": "M",
                "language": "es_ES",
                "message": "Gracias por valorar nuestra atención",
                "type": "speech"
              }
            }
          ]
        }
      },
      {
        "key": 3,
        "typeId": "AddToBlackList",
        "data": {
          "url": "http://www.audios.com/audio.wav",
          "type": "audio"
        }
      },
      {
        "key": 4,
        "typeId": "RepeatMessage"
      }
    ]
  }
}

Parameters

Parameter Type Required Description
to array Yes Mobile phone number recipient of the message. You must include the prefix (Ex: In Spain 34666666666). This field allows you to indicate multiple recipients.
callers object No Object with a list of personalized senders by country to use in the call. If the sender is not specified for a specific country, the default sender will be used. To configure a custom sender contact the support department. Example:

{"ES": "6123456789", "PT": "6987654321"}
scheduleDate string No Date the message was sent in UTC timezone. If you need to send scheduled messages, you can specify the sending date indicating the date in YYYYmmddHHiiss format (Ex: 20130215142000 would be February 15, 2013 at 2:20:00 PM). In case of immediate shipment, this parameter does not have to be specified.
expirationDate string No It allows to determine the maximum date on which the call can be made. After this deadline, the call will be canceled. Specifying the validity period will automatically activate the call retries, which will make the call again if the recipient does not answer the call. The date must be in the format YYYYmmddHHiiss (Ex: 20130215142000 would be February 15, 2013 at 2:20 pm)
campaignName string Yes Campaign name.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. Tags can be used to filter the statistics on the dashboard.
sub array No array with substitution variables that will be applied to the message.
menu object Yes Defines the menu tree in its opening speech. See menu parameters.
speechRetries integer No Number of times the voiceover will be repeated if the recipient does not interact, possible values in the range of 1 to 10.
speechTimeoutSeconds integer No This is a waiting time in seconds before repeating the speech, it depends on the speechRetries parameter, it can be a value from 1 to 30.
callRetries integer No Number of call retries for recipients, possible values in the range of 1 to 10.
costLimit integer No Shipping cost limit in euros. If the established limit is reached, the campaign will be paused and you will be notified by email.
availableTimes array No It indicates the times in which the calls will be made. Json objects are defined in the form:

[{"day": 1, "from": "09:00", "to": "21:00"}]

day: a day of the range between Monday to Sunday is indicated, it must be a number between 1 and 7.
from: time that defines the start of the time range in 24 hour format.
to: time that defines the end of the time range in 24 hour format.

Substitution variables

Custom variables can be indicated in the message body. These variables will be replaced by the contact´s custom variables or by the variables indicated in the sub parameter. When using the sub parameter, the array must contain as many items as the send recipients.

Parameter Type Required Description
type string Yes Defines the type of speech if it will be conversion from text to audio or a specific audio file.
Values can only be: 'speech' or 'audio'
The message, language and gender parameters will be required if 'speech' is specified
The url parameter will be required if 'audio' is specified.
message string No Message text. It can have a maximum of 500 characters. The text must be encoded in UTF-8.
language string No Language to convert the text, the options are:

'en_GB': English - United Kingdom,
'en_US': English - United States,
'es_ES': Spanish - España,
'es_US': Spanish - Latino,
'pt_PT': Portuguese - Portugal,
'pt_BR': Portuguese - Brazil,
'cmn_CN': Mandarin Chinese - China *,
'arb': Arab *,
'de_DE': German - Germany,
'fr_FR': French - France,
'it_IT': Italian - Italy,
'hi_IN': Indi - India *.

* Available only in female gender.
gender string No Voice gender, allowed values are 'F' for female voice and 'M' for male voice.
url string No Audio file location url with scheme and domain name eg: http://www.audios.com/audio.wav
The audio file must have the following encoding:
Bit depth: 16 bits
Sample rate: 8000 Hz
Format: wav
Channel: Mono
menuOptions array No You specify whether you want to add options to the call menu.
If this is specified, it should not be empty and should contain at least two options, these correspond to an error or omission option and at least one more additional option, these are explained in the menu option parameters section.
Each of these options must be specified as an object.
Parameter Type Required Description
key integer Yes Telephone key that the recipient can press, as the exclusive setting of the call is -1 and from 1 to 9 for the other options.
typeId string Yes Defines the types of menu options, includes the following types:
'Play': play a message
'CallTransfer': call transfer.
'GetDataWhilePlaying': Call and data collection submenu, this type is mandatory when defining a menu for the option.
'RepeatMessage': repeat the current message.
'AddToBlackList': the recipient is added to the interactive voice channel blacklist.
data object Yes It corresponds to the same menu parameters with the exception of the menuOptions parameter, and the parameters must be added if typeId is CallTransfer:
'phone': corresponds to the phone number to transfer the call without the prefix.
'phonePrefix': corresponds to the prefix of the phone to which the call will be transferred.
menu object No Mandatory if typeId has been specified as 'GetDataWhilePlaying', it corresponds to the menu parameters including menuOptions if you want to configure it but with the exception that its suboptions may no longer contain a typeid equal to 'GetDataWhilePlaying' since it is only allowed submenus up to two levels.

Landing SMS

Send Landing SMS message

POST https://dashboard.360nrs.com/api/rest/landingsms

curl -X POST 'https://dashboard.360nrs.com/api/rest/landingsms' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "to": ["34666555444"],
  "message": "TEST API LANDING {LAND_URL}",
  "from": "LANDINGAPI",
  "templateBody": "<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/landingsms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "to": ["34666555444"],
  "message": "TEST API LANDING {LAND_URL}",
  "from": "LANDINGAPI",
  "templateBody": "<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/landingsms");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"to\": [\"34666555444\"], \"message\": \"TEST API LANDING {LAND_URL}\", \"from\": \"LANDINGAPI\", \"templateBody\": \"<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/landingsms',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "to": ["34666555444"], "message": "TEST API LANDING {LAND_URL}", "from": "LANDINGAPI", "templateBody": "<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/landingsms"

payload = "{ \"to\": [\"34666555444\"], \"message\": \"TEST API LANDING {LAND_URL}\", \"from\": \"LANDINGAPI\", \"templateBody\": \"<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/landingsms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"to\": [\"34666555444\"], \"message\": \"TEST API LANDING {LAND_URL}\", \"from\": \"LANDINGAPI\", \"templateBody\": \"<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/landingsms");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"to\": [\"34666555444\"], \"message\": \"TEST API LANDING {LAND_URL}\", \"from\": \"LANDINGAPI\", \"templateBody\": \"<html><head><title>LANDING TEST</title></head><body><h1>HELLO LANDING</h1></body></html>\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

HTTP Response Code 202 (ACCEPTED)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666555444",
      "id": "XXXXXXXXXXXXX",
      "parts": 1,
      "scheduledAt": null,
      "expiresAt": null
    }
  ]
}

HTTP Response Code 207 (MULTI-STATUS)

{
  "campaignId": 100000,
  "result": [
    {
      "accepted": true,
      "to": "34666555444",
      "id": "XXXXXXXXXXXXX",
      "parts": 1,
      "scheduledAt": null,
      "expiresAt": null
    },
    {
      "accepted": false,
      "to": "34",
      "error": {
        "code": 102,
        "description": "No valid recipients"
      }
    }
  ]
}

Error response (HTTP 400)

{
  "error": {
    "code": 102,
    "description": "No valid recipients"
  }
}

Parameters

Parameter Type Mandatory Description
message string Yes Text of message. At most, there can be 160 characters if it is not specified that the message is multi-part (see parts parameter). The text must be encoded in UTF-8
to array Yes Mobile phone number to receive message. Must include the prefix (e.g. in Spain 34666666666). This field allows you to specify multiple recipients.
from string Yes Sender text, this label will consist of 15 numbers or 11 alphanumeric characters.
encoding string No Possible values are 'gsm', 'gsm-pt' and 'utf-16'. The value gsm for normal mailings with GSM7 coding and 160 characters per message, and the value utf-16 for UCS2 (UTF16) coding and 70 characters per message. If not specified, the default value is gsm.
scheduleDate string No Date of message sent in UTC format. If you need to send scheduled messages, the delivery date can be specified by indicating the date in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate mailings, this parameter does not have to be specified.
expirationDate string No Message expiration date in UTC. Format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00).
parts integer No Indicates the maximum number of parts into which the scheduled message will be divided. This variable is set to 1 by default, so if it is not specified and a message over 160 characters for gsm encoding is sent, the message will fail. Keep in mind that concatenated messages may only be 153 characters per part in gsm and 67 characters per part in utf-16 and each part is charged as one message. The server will only use the minimum necessary parts for sending the text even if the specified number of parts is higher than necessary. If the number of parts is less than that required for sending the text, the message will fail with error 105. The maximum number of parts allowed is 8.
notificationUrl string No URL to receive delivery notifications.
trans integer No Possible values are 1 and 0. With value 0, the server does not change any character in the message, as this is the default value. With value 1, the server modifies the common invalid characters in GSM7 to valid characters with the following translation table: 'á' => 'a', 'í'=>'i', 'ó'=>'o', 'ú'=>'u', 'ç'=>'Ç', 'Á'=>'A', 'Í'=>'I', 'Ó'=>'O', 'Ú'=>'U', 'À'=>'A', 'È'=>'E', 'Ì'=>'I', 'Ò'=>'O', 'Ù'=>'U', 'º' => '', 'ª' => '', 'Õ' => 'O', 'õ' => 'o', 'â' => 'a', 'ê' => 'e', 'î'=>'i', 'ô'=>'o', 'û'=>'u', ' '=>'A', 'Ê'=>'E', 'Î'=>'I', 'Ô'=>'O', 'Û'=>'U', 'ã' => 'a', 'Ã' => 'A'.
campaignName string No Campaign name. If specified, a campaign will be created with the name indicated in the dashboard and which will contain the mailing statistics. If a campaign with this name already exists, the delivery statistics will be added to the existing campaign.
tags array No campaignName is required if this parameter is specified. List of tags to add to the campaign. The tags can be used to filter the statistics in the dashboard.
certified boolean No If it is specified as true, the message will be sent as certified.
Certified messages have additional cost
sub array No array with substitution variables that will be applied to the message.
splitParts boolean No For messages that exceed the maximum SMS length, the server will split the message into multiple SMS instead of using concatenated SMS. The default value is false.
flash boolean No Flash SMS is a message that appears directly on the device screen. Depending on the model and operating system it is possible to store it in the inbox and send concatenated messages.
templateBody string No Content of the landing page in HTML format and UTF-8 encoding. Required without templateId.
templateId integer No Template ID to send as the content of the landing page. Required without templateBody.

Substitution variables

When using the sub parameter, the array must contain as many items as the send recipients, using the following format:

{
  "from": "TEST",
  "to": ["34666555444", "34666555333"],
  "message": "Hello {name}",
  "sub": [
    {"name": "first contact name"},
    {"name": "second contact name"}
  ]
}

Custom variables can be indicated in the message body. These variables will be replaced by the contact´s custom variables or by the variables indicated in the sub parameter.

Custom fields filters

It is possible to add the following filters to custom variables.

Filtro Description Example Result
lower Return lowercase text {name|lower} my name
upper Return text in uppercase {name|upper} MY NAME
capitalize Return the text with the first letter of the first word in uppercase {name|capitalize} My name
capitalizeAll Return the text with the first letter of each word in uppercase {name|capitalizeAll} My Name
formatDotComma Returns the number with a dot as thousands separator and comma as decimal separator {number|formatDotComma} 1.234,56
formatCommaDot Returns the number with a comma as thousands separator and dot as decimal separator {number|formatCommaDot} 1,234.56
shorten Returns a shortened url. It must be a valid url. {url|shorten} https://nrs.so/xxxxxx

Scheduled messages

List

GET https://dashboard.360nrs.com/api/rest/scheduled

curl -X GET 'https://dashboard.360nrs.com/api/rest/scheduled' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/scheduled',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/scheduled");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/scheduled',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/scheduled"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/scheduled")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/scheduled");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

Multi GUID

{
  "result": [
    {
      "guid": "100",
      "type": "SMS",
      "created_at": "2017-09-18 10:49:12",
      "updated_at": "2017-09-18 10:49:12",
      "scheduled_at": "2017-11-11 10:10:10"
    },
    {
      "guid": "101",
      "type": "SMS",
      "created_at": "2017-09-18 10:49:12",
      "updated_at": "2017-09-18 10:49:12",
      "scheduled_at": "2017-11-11 10:10:10"
    },
    {
      "guid": "102",
      "type": "SMS",
      "created_at": "2017-09-18 10:49:12",
      "updated_at": "2017-09-18 10:49:12",
      "scheduled_at": "2017-11-11 10:10:10"
    }
  ],
  "total": 3
}

Single GUID

{
  "result": {
    "guid": "100",
    "type": "SMS",
    "content": "Contenido del SMS",
    "created_at": "2017-09-18 10:49:12",
    "updated_at": "2017-09-18 10:49:12",
    "scheduled_at": "2017-11-11 10:10:10"
  },
  "total": 1
}

Lists all scheduled mailings. Can be filtered by type (SMS or MAILING) and can specify one GUID, multiple GUIDs or no GUIDs (to list all).

The content of the message is not shown in the list, unless a single GUID is specified.

Parameter Type Required Description
guid integer, array No Identifier of message or messages. One identifier, an array of identifiers or no identifiers can be used to show all.
type string No SMS o MAILING

Update

PUT https://dashboard.360nrs.com/api/rest/scheduled

curl -X PUT 'https://dashboard.360nrs.com/api/rest/scheduled' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "guid": [100,101],
  "scheduleDate": "20171011093000"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/scheduled',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
  "guid": [100,101],
  "scheduleDate": "20171011093000"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/scheduled");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"guid\": [100,101], \"scheduleDate\": \"20171011093000\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/scheduled',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "guid": [100,101], "scheduleDate": "20171011093000" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/scheduled"

payload = "{ \"guid\": [100,101], \"scheduleDate\": \"20171011093000\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/scheduled")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"guid\": [100,101], \"scheduleDate\": \"20171011093000\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/scheduled");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"guid\": [100,101], \"scheduleDate\": \"20171011093000\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "result": true,
  "updated": 2
}

Updates the scheduled date of a mailing, multiple mailings or all scheduled mailings. Can be filtered by GUID and/or type.

Parameter Type Required Description
guid integer, array No Identifier of message or messages. One identifier, an array of identifiers or no identifiers can be used to show all.
type string No SMS o MAILING
scheduleDate string Yes Date of sending message in UTC format. If you need to send scheduled messages, the delivery date can be specified by indicating the date in the following format YYYYmmddHHiiss (e.g. 20130215142000 would be 15 February 2013 at 14:20:00). For immediate mailings, this parameter does not have to be specified.

Delete

DELETE https://dashboard.360nrs.com/api/rest/scheduled

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/scheduled' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "guid": [100, 101]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/scheduled',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_POSTFIELDS => '{
  "guid": [100, 101]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/scheduled");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"guid\": [100, 101] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/scheduled',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "guid": [100, 101] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/scheduled"

payload = "{ \"guid\": [100, 101] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/scheduled")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"guid\": [100, 101] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/scheduled");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"guid\": [100, 101] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "result": true,
  "deleted": 2
}

Deletes a mailing, multiple mailings or all scheduled mailings. Can be filtered by GUID and/or type.

Parameter Type Required Description
guid integer, array No Identifier of message or messages. One identifier, an array of identifiers or no identifiers can be used to show all.
type string No SMS o MAILING

Campaigns list

GET https://dashboard.360nrs.com/api/rest/campaigns

curl -X GET 'https://dashboard.360nrs.com/api/rest/campaigns' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/campaigns',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/campaigns");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/campaigns',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/campaigns"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/campaigns")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/campaigns");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "id": 1,
      "name": "My campaign",
      "type": "basic",
      "createdAt": "2018-12-27T11:31:16+00:00",
      "updatedAt": "2018-12-27T11:31:16+00:00",
      "links": {
        "self": "https://dashboard.360nrs.com/api/rest/campaigns/1",
        "sendings": "https://dashboard.360nrs.com/api/rest/campaigns/1/sendings"
      },
      "sendings": {
        "data": [
          {
            "id": 1,
            "campaignName": "My campaign",
            "status": "OPENED",
            "channel": "sms",
            "total": 2,
            "processed": 2,
            "totalSmsParts": 4,
            "cost": 0.02,
            "currency": "EUR",
            "tags": [],
            "scheduledAt": null,
            "expiresAt": null,
            "startedAt": null,
            "finishedAt": null,
            "createdAt": "2018-12-27T11:31:16+00:00",
            "updatedAt": "2018-12-27T11:31:22+00:00",
            "events": {
              "delivered": 2,
              "opened": 0,
              "opened_unique": 0,
              "clicked": 0,
              "clicked_unique": 0,
              "unsubscribed": 0,
              "hard_bounced": 0,
              "complaint": 0,
              "sent": 2,
              "soft_bounced": 0,
              "undelivered": 0,
              "rejected": 0,
              "expired": 0,
              "unsubscribed_landing": 0
            },
            "links": {
              "self": "https://dashboard.360nrs.com/api/rest/sendings/1",
              "eventsReport": "https://dashboard.360nrs.com/api/rest/sendings/1/reports/events"
            }
          }
        ]
      }
    }
  ]
}

Filters

Parameter Description
name Filter by campaign name. It is possible to use the character "*" as "wildcard". Example: ?name=CAMPAIGN_2020_*
channel Filter by channel. Available values: sms, mailing, landing, text2speech, apppush, webpush Example: ?channel=sms
beforeDate Show results prior to the indicated date. The date must be specified in ISO 8601 format. Example: ?beforeDate=2019-01-01T00%3A00%3A00%2B00%3A00
afterDate Show results after the indicated date. The date must be specified in ISO 8601 format. Example: ?afterDate=2019-01-01T00%3A00%3A00%2B00%3A00

The parameters must be correctly encoded (urlencode) with respect to the RFC 3986 standard to be supported by the server.

Response fields

Parameter Description
name Campaign name.
type Campaign type. Possible values: basic, automatic, trigger, testab.
sendings List of all the sendings associated with your campaign. For basic and automatic campaigns, the sendings number will always be 1.
sendings.*.status Your sending status. Possible values:
PENDING: Sending scheduled for a future date.
SAVED: Saved sending. It will not be sent until the campaign is confirmed from the platform.
SENDING: Sending in progress.
PAUSED: Sending paused.
FINISHED: Sending finished.
CANCELLED: Sending cancelled.
EDITING: The sending is being edited from the platform.
OPENED: API shipments will report this status. Indicates that the sending can accept more messages.
AUTOMATED: Automated sending, waiting for the automation conditions to be met.
WAITING: "Trigger" sending, waiting for the sending conditions to be met.
sendings.*.channel Sending channel. Possible values: sms, mailing, landing y text2speech.
sendings.*.total Total number of messages to be sent.
sendings.*.processed Total number of messages sent.
sendings.*.totalSmsParts Only applicable to SMS sendings. The total number of SMS parts sent for concatenated sendings will be indicated.
sendings.*.cost Sending cost.
sendings.*.currency Currency code for the cost.
sendings.*.tags Tags assigned to the sending.
sendings.*.scheduledAt Schedule date of the campaign. No message will be sent before this date.
sendings.*.expiresAt Expiry date of the campaign. After this date, no more messages will be sent.
sendings.*.events Summary of the total events occurred during the sending. Events:
delivered: The message has been delivered to the contact.
opened: The contact has opened the message. Not applicable to sms and text2speech.
opened_unique: Total of unique openings. Not applicable to sms and text2speech.
clicked: The contact has clicked on a link included in the message. Not applicable to sms and text2speech.
clicked_unique: Total of unique clicks. Not applicable to sms and text2speech.
unsubscribed: The contact has unsubscribed.
hard_bounced: Total hard bounces generated by the campaign. Only applicable to mailing.
complaint: The contact has marked the message as unwanted.
sent: The message has been sent to the contact.
soft_bounced: Total soft bounces generated by the campaign. Only applicable to mailing.
undelivered: The message could not have been delivered to the contact.
rejected: The attempt to send the message has been rejected.
expired: The message has been rejected as the expiration date of the campaign has passed.
unsubscribed_landing: The contact has unsubscribed using the landing page included in the message.

Databases

Contacts

Contact list

GET https://dashboard.360nrs.com/api/rest/contacts

curl -X GET 'https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/contacts?include=customFields,groups");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "id": 1,
      "email": "email@example.com",
      "phone": "34666666666",
      "countryIso": "ES",
      "landline": "900222222",
      "name": "Name",
      "surname": "Last name",
      "createdAt": "2018-03-13T14:32:25+00:00",
      "updatedAt": "2018-07-04T13:57:09+00:00",
      "customFields": {
        "data": [
          {
            "key": "color",
            "type": "string",
            "value": "green"
          }
        ]
      },
      "groups": {
        "data": [
          {
            "id": 1,
            "name": "My Contact List"
          }
        ]
      }
    }
  ],
  "meta": {
    "pagination": {
      "total": 500,
      "count": 100,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 5,
      "links": {
        "next": "https://dashboard.360nrs.com/api/rest/contacts?include=customFields%2Cgroups&page=2"
      }
    }
  }
}

Filters

Parameter Description
limit Total contacts to display in a single request. Default value: 100. Maximum: 1000.
include Include associated subresources in the response. It is possible to specify multiple values separated by commas. Available values: customFields, groups, blacklist.
email Filter contacts for a specific email: email=myemail@example.com.
phone Filter contacts for a specific phone: phone=34666666666.
landline Filter contacts for a specific landline phone: landline=900222222.
countryIso Filter contacts for a specific country: countryIso=ES.
blacklist Filter contacts that are in any of the following blacklists. It is possible to indicate multiple values separated by commas. Available values: any, none, sms, mailing, landing, text2speech.
externalId Filter contacts for a specific externalId: externalId=EXT1.

Show a contact

GET https://dashboard.360nrs.com/api/rest/contacts/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/contacts/1?include=customFields,groups");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": {
    "id": 1,
    "email": "email@example.com",
    "phone": "34666666666",
    "countryIso": "ES",
    "landline": "900222222",
    "name": "Name",
    "surname": "Last name",
    "createdAt": "2018-03-13T14:32:25+00:00",
    "updatedAt": "2018-07-04T13:57:09+00:00",
    "customFields": {
      "data": [
        {
          "key": "color",
          "type": "string",
          "value": "green"
        }
      ]
    },
    "groups": {
      "data": [
        {
          "id": 1,
          "name": "My Contact List"
        }
      ]
    }
  }
}

Filters

Parameter Description
include Include associated subresources in the response. It is possible to specify multiple values separated by commas. Available values: customFields, groups, blacklist.

Create a new contact

POST https://dashboard.360nrs.com/api/rest/contacts

curl -X POST 'https://dashboard.360nrs.com/api/rest/contacts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "groupsNames": ["My contact list"],
    "customFields": [
        {
            "key": "company",
            "value": "ACME inc."
        }
    ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/contacts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "groupsNames": ["My contact list"],
    "customFields": [
        {
            "key": "company",
            "value": "ACME inc."
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/contacts");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/contacts',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "email": "new.contact@example.com", "phone": "3466666666", "countryIso": "ES", "groupsNames": ["My contact list"], "customFields": [ { "key": "company", "value": "ACME inc." } ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/contacts"

payload = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/contacts")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/contacts");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 201)

{
  "data": {
    "id": 1,
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "landline": null,
    "name": null,
    "surname": null,
    "createdAt": "2018-03-13T14:32:25+00:00",
    "updatedAt": "2018-03-13T14:32:25+00:00",
    "links": {
      "self": "https://dashboard.360nrs.com/api/rest/contacts/1"
    }
  }
}

Error response

{
  "error": {
    "code": 422,
    "description": "The email field is required."
  }
}

Parameters

Parameter Type Required Description
email string Required when phone or landline is not specified Email of the new contact.
phone string Required when email or landline is not specified Mobile phone number of the contact.
landline string Required when email or phone is not specified Landline phone number of the contact.
countryIso string Required when phone or landline is specified Two-letter ISO code of the contact's country.
groupsIds array Required if groupsNames is not specified List of groups to which the new contact will be added. To obtain group IDs please check the documentation for the corresponding endpoint.
groupsNames array Required if groupsIds is not specified Alternatively, if the list of group IDs is not available, a list with the group names to which the contact is to be added can be specified.
name string No Contact name.
surname string No Contact surname(s).
customFields[]key string No Name of the custom field to be added.
customFields[]type string No Type of custom field. Possible values: string, date, decimal. For date fields the value must be in ISO8601 format. Default value: string.
customFields[]value string No Custom field value.

Update a contact

PUT https://dashboard.360nrs.com/api/rest/contacts/<ID>

curl -X PUT 'https://dashboard.360nrs.com/api/rest/contacts/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "groupsNames": ["My contact list"],
    "customFields": [
        {
            "key": "company",
            "value": "ACME inc."
        }
    ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/contacts/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "groupsNames": ["My contact list"],
    "customFields": [
        {
            "key": "company",
            "value": "ACME inc."
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/contacts/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/contacts/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "email": "new.contact@example.com", "phone": "3466666666", "countryIso": "ES", "groupsNames": ["My contact list"], "customFields": [ { "key": "company", "value": "ACME inc." } ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/contacts/1"

payload = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/contacts/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/contacts/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"email\": \"new.contact@example.com\", \"phone\": \"3466666666\", \"countryIso\": \"ES\", \"groupsNames\": [\"My contact list\"], \"customFields\": [ { \"key\": \"company\", \"value\": \"ACME inc.\" } ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": {
    "id": 1,
    "email": "new.contact@example.com",
    "phone": "3466666666",
    "countryIso": "ES",
    "landline": null,
    "name": null,
    "surname": null,
    "createdAt": "2018-03-13T14:32:25+00:00",
    "updatedAt": "2018-03-13T14:32:25+00:00",
    "links": {
      "self": "https://dashboard.360nrs.com/api/rest/contacts/1"
    }
  }
}

Error response

{
  "error": {
    "code": 422,
    "description": "The email field is required."
  }
}

Parameters

Parameter Type Required Description
email string Required when phone or landline is not specified Email of the new contact.
phone string Required when email or landline is not specified Mobile phone number of the contact.
landline string Required when email or phone is not specified Landline phone number of the contact.
countryIso string Required when phone or landline is specified Two-letter ISO code of the contact's country.
groupsIds array Required if groupsNames is not specified List of groups to which the new contact will be added. To obtain group IDs please check the documentation for the corresponding endpoint.
groupsNames array Required if groupsIds is not specified Alternatively, if the list of group IDs is not available, a list with the group names to which the contact is to be added can be specified.
name string No Contact name.
surname string No Contact surname(s).
customFields[]key string No Name of the custom field to be added.
customFields[]type string No Type of custom field. Possible values: string, date, decimal. For date fields the value must be in ISO8601 format. Default value: string.
customFields[]value string No Custom field value.

Delete a contact

DELETE https://dashboard.360nrs.com/api/rest/contacts/<ID>

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/contacts/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/contacts/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/contacts/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/contacts/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/contacts/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/contacts/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/contacts/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

If the request has been successful, it will respond with an HTTP 204 code.

Groups

Groups list

GET https://dashboard.360nrs.com/api/rest/groups

curl -X GET 'https://dashboard.360nrs.com/api/rest/groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/groups',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/groups");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/groups',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/groups"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/groups")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/groups");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "id": 1,
      "name": "My contact list"
    }
  ],
  "meta": {
    "pagination": {
      "total": 500,
      "count": 100,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 5,
      "links": {
        "next": "https://dashboard.360nrs.com/api/rest/groups?page=2"
      }
    }
  }
}

Filters

Parameter Description
limit Total contacts to display in a single request. Default value: 100. Maximum: 1000.

Show a group

GET https://dashboard.360nrs.com/api/rest/groups/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/groups/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/groups/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/groups/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/groups/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/groups/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/groups/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/groups/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": {
    "id": 1,
    "name": "My contact list"
  }
}

Filters

Parameter Description
include Include associated subresources in the response. You can specify multiple values by separating them with commas. Available values: customFields, groups, blacklist.

Create a new group

POST https://dashboard.360nrs.com/api/rest/groups

curl -X POST 'https://dashboard.360nrs.com/api/rest/groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "name": "My new contact list"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/groups',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "name": "My new contact list"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/groups");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"My new contact list\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/groups',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "My new contact list" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/groups"

payload = "{ \"name\": \"My new contact list\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/groups")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"My new contact list\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/groups");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"My new contact list\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 201)

{
  "data": {
    "id": 1,
    "name": "My new contact list"
  }
}

Error response

{
  "error": {
    "code": 422,
    "description": "The name field is required."
  }
}

Parameters

Parameter Type Required Description
name string Yes Name of the New Group.

Update a group

PUT https://dashboard.360nrs.com/api/rest/groups/<ID>

curl -X PUT 'https://dashboard.360nrs.com/api/rest/groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "name": "My new contact list"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/groups',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
    "name": "My new contact list"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/groups");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"My new contact list\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/groups',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "My new contact list" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/groups"

payload = "{ \"name\": \"My new contact list\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/groups")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"My new contact list\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/groups");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"My new contact list\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": {
    "id": 1,
    "name": "My new contact list"
  }
}

Error response

{
  "error": {
    "code": 422,
    "description": "The name field is required."
  }
}

Parameters

Parameter Type Required Description
name string Yes Name of the New Group.

Delete a group

DELETE https://dashboard.360nrs.com/api/rest/groups/<ID>

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/groups/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/groups/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/groups/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/groups/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/groups/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/groups/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/groups/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

If the request has been successful, it will respond with an HTTP 204 code.

Email validation

Validation list

GET https://dashboard.360nrs.com/api/rest/validation/emails

curl -X GET 'https://dashboard.360nrs.com/api/rest/validation/emails' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/validation/emails',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/validation/emails");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/validation/emails',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/validation/emails"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/validation/emails")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/validation/emails");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": [
    {
      "id": 1,
      "status": "finished",
      "total": 10,
      "processed": 10,
      "valid": 9,
      "estimatedCost": 0.03,
      "cost": 0.03,
      "currency": "EUR",
      "createdAt": "2018-09-20T08:30:54+00:00",
      "updatedAt": "2018-09-20T08:31:00+00:00",
      "finishedAt": "2018-09-20T08:31:00+00:00",
      "resultUrl": "https://dashboard.360nrs.com/api/rest/validation/emails/1/result"
    }
  ],
  "meta": {
    "pagination": {
      "total": 500,
      "count": 100,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 5,
      "links": {
        "next": "https://dashboard.360nrs.com/api/rest/validation/emails?page=2"
      }
    }
  }
}

Show a validation

GET https://dashboard.360nrs.com/api/rest/validation/emails/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/validation/emails/123' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/validation/emails/123',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/validation/emails/123");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/validation/emails/123',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/validation/emails/123"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/validation/emails/123")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/validation/emails/123");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": {
    "id": 1,
    "status": "finished",
    "total": 2,
    "processed": 2,
    "valid": 1,
    "estimatedCost": 0.007,
    "cost": 0.007,
    "currency": "EUR",
    "createdAt": "2018-09-20T08:30:54+00:00",
    "updatedAt": "2018-09-20T08:31:00+00:00",
    "finishedAt": "2018-09-20T08:31:00+00:00",
    "resultUrl": "https://dashboard.360nrs.com/api/rest/validation/emails/1/result"
  }
}

Validation results (CSV)

GET https://dashboard.360nrs.com/api/rest/validation/emails/<ID>/result

curl -X GET 'https://dashboard.360nrs.com/api/rest/validation/emails/123/result' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/validation/emails/123/result',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/validation/emails/123/result");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/validation/emails/123/result',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/validation/emails/123/result"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/validation/emails/123/result")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/validation/emails/123/result");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

email;result
valid@example.com;deliverable
notvalid@example.com;undeliverable
unknown@example.com;risky

Validate emails

POST https://dashboard.360nrs.com/api/rest/validation/emails

curl -X POST 'https://dashboard.360nrs.com/api/rest/validation/emails' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
    "groupsIds": [1111],
    "force": false,
    "notificationUrl": "https://example.com/notificationUrl"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/validation/emails',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "groupsIds": [1111],
    "force": false,
    "notificationUrl": "https://example.com/notificationUrl"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/validation/emails");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"groupsIds\": [1111], \"force\": false, \"notificationUrl\": \"https://example.com/notificationUrl\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/validation/emails',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "groupsIds": [1111], "force": false, "notificationUrl": "https://example.com/notificationUrl" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/validation/emails"

payload = "{ \"groupsIds\": [1111], \"force\": false, \"notificationUrl\": \"https://example.com/notificationUrl\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/validation/emails")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"groupsIds\": [1111], \"force\": false, \"notificationUrl\": \"https://example.com/notificationUrl\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/validation/emails");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"groupsIds\": [1111], \"force\": false, \"notificationUrl\": \"https://example.com/notificationUrl\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": {
    "id": 2,
    "status": "pending",
    "total": 1,
    "processed": 0,
    "valid": 0,
    "estimatedCost": 0.0035,
    "cost": 0,
    "currency": "EUR",
    "createdAt": "2018-09-20T10:03:22+00:00",
    "updatedAt": "2018-09-20T10:03:22+00:00",
    "finishedAt": null,
    "resultUrl": null
  }
}

The validation is done in the following way, a request is made indicating the group IDs or emails to validate. It is possible to validate one or more groups. It is possible to validate one or more emails.

If the request is correct, the request will return the status "pending", which means that it is queued to be processed.

Once the validation process starts, it will notify with an "started" status and when it finishes it will notify with "finished" with the data with the total of processed and the total of valid among other data. Also in the "finished" notification the url will be received in order to obtain the complete detail.

Parameters

Parameter Type Mandatory Description
groupsIds array No (whenever there are emails) List of groups to be validated (consult groups endpoint) within the contacts API.
emails array No (whenever there are groupIds) List of emails to validate.
force boolean No In case of being true, emails that have already been verified will be verified. Default value false.
notificationUrl string No Callback URL in which progress notifications will be received (see notification annex)

Delete a validation

DELETE https://dashboard.360nrs.com/api/rest/validation/emails/<ID>

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/validation/emails/123' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/validation/emails/123',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/validation/emails/123");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/validation/emails/123',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/validation/emails/123"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/validation/emails/123")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/validation/emails/123");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

It is possible to eliminate a validation from your list of validations.

If the request has been successful, it will respond with an HTTP 204 code.

Notification examples

Notification STARTED

{
  "data": {
    "id": 2,
    "status": "started",
    "total": 1,
    "processed": 0,
    "valid": 0,
    "estimatedCost": 0.0035,
    "cost": 0.0035,
    "currency": "EUR",
    "createdAt": "2018-09-20T10:03:22+00:00",
    "updatedAt": "2018-09-20T10:03:22+00:00",
    "finishedAt": null,
    "resultUrl": null,
    "error": ""
  }
}

Notification FINISHED

{
  "data": {
    "id": 2,
    "status": "finished",
    "total": 1,
    "processed": 1,
    "valid": 1,
    "estimatedCost": 0.0035,
    "cost": 0.0035,
    "currency": "EUR",
    "createdAt": "2018-09-20T07:23:19+00:00",
    "updatedAt": "2018-09-20T07:23:56+00:00",
    "finishedAt": "2018-09-20T07:23:56+00:00",
    "resultUrl": "https://dashboard.360nrs.com/api/rest/validation/emails/2/result",
    "error": ""
  }
}

Notification FAILED

{
  "data": {
    "id": 2,
    "status": "failed",
    "total": 1,
    "processed": 0,
    "valid": 0,
    "estimatedCost": 0.0035,
    "cost": 0,
    "currency": "EUR",
    "createdAt": "2018-09-20T10:03:22+00:00",
    "updatedAt": "2018-09-20T10:03:22+00:00",
    "finishedAt": null,
    "resultUrl": null,
    "error": "Failed to process email validation"
  }
}

Blacklist

Listing of contacts in the blacklist

GET https://dashboard.360nrs.com/api/rest/blacklist

curl -X GET 'https://dashboard.360nrs.com/api/rest/blacklist' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/blacklist',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/blacklist");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/blacklist',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/blacklist"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/blacklist")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/blacklist");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "channel": "sms",
      "campaignName": "TEST_CAMPAIGN",
      "isDefinitive": false,
      "createdAt": "2020-01-01T00:00:00+00:00",
      "contact": {
        "data": {
          "id": 1,
          "email": "test@example.com",
          "phone": "34666666666",
          "countryIso": "ES",
          "landline": null,
          "name": "Contact name",
          "surname": "Contact surname",
          "createdAt": "2020-01-01T00:00:00+00:00",
          "updatedAt": "2020-01-01T00:00:00+00:00",
          "links": {
            "self": "https://dashboard.360nrs.com/api/rest/contacts/1"
          }
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "total": 500,
      "count": 100,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 5,
      "links": {
        "next": "https://dashboard.360nrs.com/api/rest/groups?page=2"
      }
    }
  }
}

Filters

Parameter Description
limit Total of contacts to be shown in a single request. Default value: 100. Maximum: 1000.
channel Filtering the blacklist per channel. It is possible to indicate different values separated by commas. Values available: sms, mailing, landing, text2speech ?channel=sms,mailing.
campaignName Filtering the blacklist by the campaign name from which the contact opted out. ?campaignName=TEST_CAMPAIGN.
campaignId Filtering the blacklist by the campaign ID from which the contact opted out. ?campaignId=1111.
isDefinitive Filtering editable/definitive registers. When an opt out is requested by the user the entry in the blacklist cannot be edited. ?isDefinitive=0.
contactId Filtering by contact ID. ?contactId=1111.
phone Filtering by contact phone number. ?phone=34666666666.
email Filtering by contact e-mail. ?email=test%40example.com.
landline Filtering by contact landline number. ?landline=900222222.
countryIso Filtering by contact country. ?countryIso=ES.

Adding a contact to the blacklist

PUT https://dashboard.360nrs.com/api/rest/blacklist

curl -X PUT 'https://dashboard.360nrs.com/api/rest/blacklist' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "channel": "sms",
  "phone": "34666666666"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/blacklist',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
  "channel": "sms",
  "phone": "34666666666"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/blacklist");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/blacklist',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "channel": "sms", "phone": "34666666666" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/blacklist"

payload = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/blacklist")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/blacklist");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": {
    "channel": "sms",
    "campaignName": null,
    "isDefinitive": false,
    "createdAt": "2020-01-01T00:00:00+00:00",
    "contact": {
      "data": {
        "id": 1,
        "email": null,
        "phone": "34666666666",
        "countryIso": "ES",
        "landline": null,
        "name": null,
        "surname": null,
        "createdAt": "2020-01-01T00:00:00+00:00",
        "updatedAt": "2020-01-01T00:00:00+00:00",
        "links": {
          "self": "https://dashboard.360nrs.com/api/rest/contacts/1"
        }
      }
    }
  }
}

Parameters

Parámetro Tipo Obligatorio Descripción
channel string Yes Channel to which the contact has to be added to the blacklist. Values allowed: sms, mailing, landing, text2speech
contactId integer Obligatory when phone, email or landline are not specified. Contact ID.
phone string Obligatory when contactId, email or landline are not specified. Contact telephone number.
email string Obligatory when contactId, phone or landline are not specified. Contact e-mail.
landline string Obligatory when contactId, phone or email are not specified. Contact landline number.

Removing a contact from the blacklist

DELETE https://dashboard.360nrs.com/api/rest/blacklist

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/blacklist' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "channel": "sms",
  "phone": "34666666666"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/blacklist',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_POSTFIELDS => '{
  "channel": "sms",
  "phone": "34666666666"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/blacklist");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/blacklist',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "channel": "sms", "phone": "34666666666" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/blacklist"

payload = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/blacklist")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/blacklist");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"channel\": \"sms\", \"phone\": \"34666666666\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Parameters

Parámetro Tipo Obligatorio Descripción
channel string Yes Channel to which the contact has to be added to the blacklist. Values allowed: sms, mailing, landing, text2speech
contactId integer Obligatory when phone, email or landline are not specified. Contact ID.
phone string Obligatory when contactId, email or landline are not specified. Contact telephone number.
email string Obligatory when contactId, phone or landline are not specified. Contact e-mail.
landline string Obligatory when contactId, phone or email are not specified. Contact landline number.

If the request has been correct it will be answered with a HTTP 204 code.

Templates and files

Templates

List templates

GET https://dashboard.360nrs.com/api/rest/templates

curl -X GET 'https://dashboard.360nrs.com/api/rest/templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/templates',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "id": 1,
      "name": "Template 1",
      "html": "<h1>Hello world</h1>",
      "createdAt": "2018-08-17T12:31:10+00:00",
      "updatedAt": null
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 1,
      "links": []
    }
  }
}

Show a template

GET https://dashboard.360nrs.com/api/rest/templates/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/templates/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/templates/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 200)

{
  "data": {
    "id": 1,
    "name": "Template 1",
    "html": "<h1>Hello world</h1>",
    "createdAt": "2018-08-17T12:31:10+00:00",
    "updatedAt": null
  }
}

Create a new template

POST https://dashboard.360nrs.com/api/rest/templates

curl -X POST 'https://dashboard.360nrs.com/api/rest/templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "name": "New Template",
  "html": "<h1>Hello world</h1>"    
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "name": "New Template",
  "html": "<h1>Hello world</h1>"    
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/templates',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "New Template", "html": "<h1>Hello world</h1>" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates"

payload = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 201)

{
  "data": {
    "id": 1,
    "name": "New Template",
    "html": "<h1>Hello world</h1>",
    "createdAt": "2020-01-00T00:00:00+00:00",
    "updatedAt": "2020-01-00T00:00:00+00:00",
    "links": {
      "self": "https://dashboard.360nrs.com/api/rest/templates/1",
      "preview": "https://dashboard.360nrs.com/api/rest/templates/1/preview"
    }
  }
}
Parameter Type Required Description
name string Yes Template Name.
html string Yes Content of the template in HTML format and UTF-8 coding.

Update a template

PUT https://dashboard.360nrs.com/api/rest/templates/<ID>

curl -X PUT 'https://dashboard.360nrs.com/api/rest/templates/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "name": "New Template",
  "html": "<h1>Hello world</h1>"    
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
  "name": "New Template",
  "html": "<h1>Hello world</h1>"    
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/templates/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "New Template", "html": "<h1>Hello world</h1>" }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates/1"

payload = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"New Template\", \"html\": \"<h1>Hello world</h1>\" }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response (HTTP 201)

{
  "data": {
    "id": 1,
    "name": "New Template",
    "html": "<h1>Hello world</h1>",
    "createdAt": "2020-01-00T00:00:00+00:00",
    "updatedAt": "2020-01-00T00:00:00+00:00",
    "links": {
      "self": "https://dashboard.360nrs.com/api/rest/templates/1",
      "preview": "https://dashboard.360nrs.com/api/rest/templates/1/preview"
    }
  }
}
Parameter Type Required Description
name string Yes Template Name.
html string Yes Content of the template in HTML format and UTF-8 coding.

Delete a template

DELETE https://dashboard.360nrs.com/api/rest/templates/<ID>

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/templates/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/templates/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

If the request has been successful, it will respond with an HTTP 204 code.

Preview a template

GET https://dashboard.360nrs.com/api/rest/templates/<ID>/preview

curl -X GET 'https://dashboard.360nrs.com/api/rest/templates/1/preview' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/templates/1/preview',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/templates/1/preview");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/templates/1/preview',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/templates/1/preview"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/templates/1/preview")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/templates/1/preview");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

The response will contain a preview of the template in HTML format.

Custom variables

Custom variables can be used on templates. These variables will be replaced by the contact´s custom fields before sending by using the syntax {variable}.

For example, to include the custom variable "name" in a HTML template:

<html>
<head>
    <title>TEST</title>
</head>
<body>
    <h1>Hello {name}</h1>
</body>
</html>

The templates accept the following substitution patterns for HTML links.

Pattern Description
[unsubscribe_link] Link to the unsubscribe page.
[form_{ID}] Link to the form with id {ID}
[show_link] Link to preview the template from the web browser. Useful for mail sendings.
[attachment_{ID}] Link to the attachment with id {ID}

For example to include a link to the form with id "12":

<a href="[form_12]">Form link</a>

Forms

Create a form

POST https://dashboard.360nrs.com/api/rest/form

curl -X POST 'https://dashboard.360nrs.com/api/rest/forms' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "name": "My_form",
  "rejectButton": true,
  "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg",
  "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png",
  "formFields": [
    {"type": "h3", "label": "Your opinion is very important to us"},
    {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"}
  ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "name": "My_form",
  "rejectButton": true,
  "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg",
  "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png",
  "formFields": [
    {"type": "h3", "label": "Your opinion is very important to us"},
    {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"}
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/forms',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "My_form", "rejectButton": true, "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg", "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png", "formFields": [ {"type": "h3", "label": "Your opinion is very important to us"}, {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"} ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms"

payload = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Example Request

{
  "name": "My_form",
  "rejectButton": true,
  "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg",
  "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png",
  "formFields": [
    {
      "type": "h3",
      "label": "Your opinion is very important to us"
    },
    {
      "type": "text",
      "label": "Name",
      "required": true,
      "description": "Insert your name",
      "placeholder": "Insert your name",
      "customField": "form_name"
    },
    {
      "type": "email",
      "label": "Email",
      "required": true,
      "description": "Insert your email",
      "placeholder": "Insert your email",
      "customField": "form_email"
    },
    {
      "type": "radio",
      "label": "How satisfied are you with our platform?",
      "required": true,
      "description": "Select your response depending on your satisfaction",
      "customField": "form_satisfaction",
      "options": [
        {
          "label": "Very satisfied",
          "value": "10"
        },
        {
          "label": "Somewhat satisfied",
          "value": "8"
        },
        {
          "label": "Neither satisfied nor dissatisfied",
          "value": "6"
        },
        {
          "label": "Somewhat dissatisfied",
          "value": "4"
        },
        {
          "label": "Very dissatisfied",
          "value": "2"
        }
      ]
    }
  ]
}

Parameters

Parameter Type Required Description
name string Yes Unique name of the form.
editable boolean No 'true': once sent, the client can send it again.
'false': once sent, the client will not be able to send it again. true by default.
rejectButton boolean No 'true': in addition to Submit button, Reject button will appear. Reject button does not send the data.
'false': only Submit button will appear. false by default.
backgroundUrl string No Form background image url.
logoUrl string No Form logo image url.
formFields array Yes Set of elements that the form will have. See annex to see all the elements.

Form example:

Update a form

PUT https://dashboard.360nrs.com/api/rest/forms/<ID>

curl -X PUT 'https://dashboard.360nrs.com/api/rest/forms' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "name": "My_form",
  "rejectButton": true,
  "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg",
  "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png",
  "formFields": [
    {"type": "h3", "label": "Your opinion is very important to us"},
    {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"}
  ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS => '{
  "name": "My_form",
  "rejectButton": true,
  "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg",
  "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png",
  "formFields": [
    {"type": "h3", "label": "Your opinion is very important to us"},
    {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"}
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("PUT");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://dashboard.360nrs.com/api/rest/forms',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "name": "My_form", "rejectButton": true, "backgroundUrl": "https://dashboard.360nrs.com/assets/login/img/wizard.jpg", "logoUrl": "https://dashboard.360nrs.com/assets/img/logo.png", "formFields": [ {"type": "h3", "label": "Your opinion is very important to us"}, {"type": "text", "label": "Name", "required": true, "description": "Insert your name", "placeholder": "Insert your name", "customField": "form_name"} ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms"

payload = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms");
      client.Timeout = -1;
      var request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"name\": \"My_form\", \"rejectButton\": true, \"backgroundUrl\": \"https://dashboard.360nrs.com/assets/login/img/wizard.jpg\", \"logoUrl\": \"https://dashboard.360nrs.com/assets/img/logo.png\", \"formFields\": [ {\"type\": \"h3\", \"label\": \"Your opinion is very important to us\"}, {\"type\": \"text\", \"label\": \"Name\", \"required\": true, \"description\": \"Insert your name\", \"placeholder\": \"Insert your name\", \"customField\": \"form_name\"} ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Parameters

Parameter Type Required Description
name string Yes Unique name of the form.
editable boolean No 'true': once sent, the client can send it again.
'false': once sent, the client will not be able to send it again. true by default.
rejectButton boolean No 'true': in addition to Submit button, Reject button will appear. Reject button does not send the data.
'false': only Submit button will appear. false by default.
backgroundUrl string No Form background image url.
logoUrl string No Form logo image url.
formFields array Yes Set of elements that the form will have. See annex to see all the elements.

Form list

GET https://dashboard.360nrs.com/api/rest/forms

curl -X GET 'https://dashboard.360nrs.com/api/rest/forms' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/forms',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
    "data": [
        {
            "id": 1,
            "name": "Form 1",
            "placeholder": "{FORM_1}",
            "createdAt": "2018-08-21T11:51:33+00:00",
            "updatedAt": null
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 100,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

Show a form

GET https://dashboard.360nrs.com/api/rest/forms/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/forms/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/forms/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
    "data": {
        "id": 1,
        "name": "Form 1",
        "placeholder": "{FORM_1}",
        "createdAt": "2018-08-21T11:51:33+00:00",
        "updatedAt": null
    }
}

Delete a form

DELETE https://dashboard.360nrs.com/api/rest/forms/<ID>

curl -X DELETE 'https://dashboard.360nrs.com/api/rest/forms/1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms/1");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("DELETE");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://dashboard.360nrs.com/api/rest/forms/1',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms/1"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms/1");
      client.Timeout = -1;
      var request = new RestRequest(Method.DELETE);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

If the request has been successful, it will respond with an HTTP 204 code.

Preview a form

GET https://dashboard.360nrs.com/api/rest/forms/<ID>/preview

curl -X GET 'https://dashboard.360nrs.com/api/rest/forms/1/preview' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/forms/1/preview',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/forms/1/preview");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/forms/1/preview',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/forms/1/preview"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/forms/1/preview")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/forms/1/preview");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

The response will contain a preview of the form in HTML format. If the request has been successful, it will respond with an HTTP 200 code.

Form elements

H1

H1

{
  "type": "h1",
  "label": "My title"
}

H2

H2

{
  "type": "h2",
  "label": "My title"
}

H3

H3

{
  "type": "h3",
  "label": "My title"
}

H4

H4

{
  "type": "h4",
  "label": "My title"
}

Paragraph

Paragraph

{
  "type": "p",
  "label": "This is my paragraph"
}

Blockquote

Blockquote

{
  "type": "blockquote",
  "label": "My blockquote"
}

Input text

Input text

{
  "type": "text",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_string_custom_field"
}

Input password

Input password

{
  "type": "password",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_string_custom_field"
}

Input email

Input email

{
  "type": "email",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_string_custom_field"
}

Input number

Input number

{
  "type": "number",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_decimal_custom_field"
}

Textarea

Textarea

{
  "type": "textarea",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_string_custom_field",
  "rows": 3
}

Date picker

Date picker

{
  "type": "date",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_date_custom_field"
}

Color picker

Color picker

{
  "type": "color",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "placeholder": "My placeholder",
  "customField": "my_string_custom_field"
}

Country select

Country select

{
  "type": "countrySelector",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "customField": "my_string_custom_field"
}

Select

Select

{
  "type": "select",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "customField": "my_string_custom_field",
  "options": [
    {"label": "Label 1", "value": "value1"},
    {"label": "Label 2", "value": "value2"},
    {"label": "Label 3", "value": "value3"}
  ]
}

Input radio

Input radio

{
  "type": "radio",
  "label": "My field",
  "required": true,
  "description": "Help text",
  "customField": "my_string_custom_field",
  "options": [
    {"label": "Label 1", "value": "value1"},
    {"label": "Label 2", "value": "value2"},
    {"label": "Label 3", "value": "value3"}
  ]
}

Input checkbox

Input checkbox

{
  "type": "checkbox",
  "label": "My checkbox text",
  "required": true,
  "customField": "my_decimal_custom_field",
}

URL Shortener

Generation short URLs

POST https://dashboard.360nrs.com/api/rest/shortener/shorten

Request

curl -X POST 'https://dashboard.360nrs.com/api/rest/shortener/shorten' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "urls": [
    {"longUrl": "https://example.com/test1"},
    {"longUrl": "https://example.com/test2"},
    {"longUrl": "invalidUrl"}
  ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/shortener/shorten',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "urls": [
    {"longUrl": "https://example.com/test1"},
    {"longUrl": "https://example.com/test2"},
    {"longUrl": "invalidUrl"}
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/shortener/shorten");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"urls\": [ {\"longUrl\": \"https://example.com/test1\"}, {\"longUrl\": \"https://example.com/test2\"}, {\"longUrl\": \"invalidUrl\"} ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/shortener/shorten',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "urls": [ {"longUrl": "https://example.com/test1"}, {"longUrl": "https://example.com/test2"}, {"longUrl": "invalidUrl"} ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/shortener/shorten"

payload = "{ \"urls\": [ {\"longUrl\": \"https://example.com/test1\"}, {\"longUrl\": \"https://example.com/test2\"}, {\"longUrl\": \"invalidUrl\"} ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/shortener/shorten")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"urls\": [ {\"longUrl\": \"https://example.com/test1\"}, {\"longUrl\": \"https://example.com/test2\"}, {\"longUrl\": \"invalidUrl\"} ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/shortener/shorten");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"urls\": [ {\"longUrl\": \"https://example.com/test1\"}, {\"longUrl\": \"https://example.com/test2\"}, {\"longUrl\": \"invalidUrl\"} ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "longUrl": "https://example.com/test1",
      "shortUrl": "https://nrs.so/dvRINN",
      "error": false
    },
    {
      "longUrl": "https://example.com/test2",
      "shortUrl": "https://nrs.so/GFA6Fm",
      "error": false
    },
    {
      "longUrl": "invalidUrl",
      "shortUrl": null,
      "error": true
    }
  ]
}

Image generator

Generation of images

POST https://dashboard.360nrs.com/api/rest/images/generate

Request

curl -X POST 'https://dashboard.360nrs.com/api/rest/images/generate' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN' \
-d '{
  "images": [
    {
        "externalId": "test1",
        "extension": "jpg",
        "base64": "BASE64_ENCODED_STRING"
    },
    {
        "externalId": "test2",
        "extension": "png",
        "base64": "BASE64_ENCODED_STRING"
    }
  ]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/images/generate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "images": [
    {
        "externalId": "test1",
        "extension": "jpg",
        "base64": "BASE64_ENCODED_STRING"
    },
    {
        "externalId": "test2",
        "extension": "png",
        "base64": "BASE64_ENCODED_STRING"
    }
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/images/generate");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      String requestBody = "{ \"images\": [ { \"externalId\": \"test1\", \"extension\": \"jpg\", \"base64\": \"BASE64_ENCODED_STRING\" }, { \"externalId\": \"test2\", \"extension\": \"png\", \"base64\": \"BASE64_ENCODED_STRING\" } ] }";
      connection.setDoOutput(true);
      DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
      wr.writeBytes(requestBody);
      wr.flush();
      wr.close();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://dashboard.360nrs.com/api/rest/images/generate',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  },
  'body': '{ "images": [ { "externalId": "test1", "extension": "jpg", "base64": "BASE64_ENCODED_STRING" }, { "externalId": "test2", "extension": "png", "base64": "BASE64_ENCODED_STRING" } ] }'
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/images/generate"

payload = "{ \"images\": [ { \"externalId\": \"test1\", \"extension\": \"jpg\", \"base64\": \"BASE64_ENCODED_STRING\" }, { \"externalId\": \"test2\", \"extension\": \"png\", \"base64\": \"BASE64_ENCODED_STRING\" } ] }"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/images/generate")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"
request.body = "{ \"images\": [ { \"externalId\": \"test1\", \"extension\": \"jpg\", \"base64\": \"BASE64_ENCODED_STRING\" }, { \"externalId\": \"test2\", \"extension\": \"png\", \"base64\": \"BASE64_ENCODED_STRING\" } ] }"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/images/generate");
      client.Timeout = -1;
      var request = new RestRequest(Method.POST);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      request.AddParameter("application/json", "{ \"images\": [ { \"externalId\": \"test1\", \"extension\": \"jpg\", \"base64\": \"BASE64_ENCODED_STRING\" }, { \"externalId\": \"test2\", \"extension\": \"png\", \"base64\": \"BASE64_ENCODED_STRING\" } ] }",  ParameterType.RequestBody);
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Response

{
  "data": [
    {
      "externalId": "test1",
      "imageUrl": "https://dashboard.360nrs.com/uploads/UCuh4pdOsW58ZEXX/1b4f0e9851971998e732078544c96b36c3d01cedf7caa332359d6f1d83567014.jpg",
      "error": false
    },
    {
      "externalId": "test2",
      "imageUrl": "https://dashboard.360nrs.com/uploads/UCuh4pdOsW58ZEXX/60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.jpg",
      "error": false
    }
  ]
}

Parameters

Parameter Type Mandatory Description
externalId string Yes External ID to identify the image in the response.
extension string Yes Image extension. Allowed extensions: jpg, png.
base64 string Yes Base64 encoded image.

Certified SMS

Download PDF Certificate

GET https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>

curl -X GET 'https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/sms/certificates/<ID>");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}
Parameter Type Mandatory Description
id string Yes Identifier of the message returned in the response of api/rest/sms in the id field.

Eventos

Event Notifications

Introduction

The status notification service sets out to inform the customer's server about the events generated in the 360NRS service. Notifications will be made for mailings sent via any type of channel. This means that the customer can track each mailing in real time.

A single mailing can cause multiple events, so a bulk mailing may generate a significant number of notifications to the customer's server. To avoid server saturation, the events to be notified are queued up in 360NRS, so there may be a delay in delivering notifications if the customer's server is unable to manage the volume of notifications generated.

In order to enable this functionality, the customer must provide a URL where http POST requests will be made to notify an event.

Receiving new notification events

HTTP METHOD: POST

Parameters

Parameter Type Description
id string Alphanumeric identifier that was delivered in the message API. If the message was sent via the website, it will have no value.
channel string Indicates the channel of the mailing to which the notification refers. The possible values are: sms, mailing, landing, text2speech.
contactId integer Unique contact identifier.
campaignId integer Campaign identifier. If it was sent by API and you did not specify campaignName in the mailing, its value will be 0.
campaignName string Campaign name. If it was sent by API and you did not specify campaignName in the mailing, its chain value will be blank.
formId integer Unique form identifier. (Only for form events)
event string Indicates the event that has occurred. The possible values are: delivered, opened, clicked, unsubscribed, hard_bounced, complaint, sent, soft_bounced, undelivered, rejected, expired, unsubscribed_landing, form_opened, form_submitted, form_rejected.
extra string Extra parameter with additional information of the event in JSON format.
The "form_submitted" event will contain the values entered in the form by the user in the following format:

{"formValues":{"param1":"value1", "param2": "value2", ...}}

The "clicked" event will contain the encoded url that has been clicked:

{"url":"url_encoded"}.
smtpResponse string Optional variable defined for the email channel and for the events delivered, hard_bounced, soft_bounced. The response of the SMTP server of the recipient mail is returned.

Notifications will be retried up to 5 times in case the client's server responds with an HTTP code other than 200 OK.

The waiting period between notifications is progressive, so the first retry will be made within 1 minute, the second after 2 minutes since the previous retry, the third after 3 minutes, etc.

Events report by sending

Reporte de eventos

GET https://dashboard.360nrs.com/api/rest/sendings/<sendingId>/reports/events

curl -X GET 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/events' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/events',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/sendings/1/reports/events");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/events',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/sendings/1/reports/events"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/sendings/1/reports/events")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/sendings/1/reports/events");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Filters

Parameter Description
beforeDate Show the results previous to the indicated date. The date should be specified in ISO 8601 format.
afterDate Show the results after the indicated date. The date should be specified in ISO 8601 format.

The parameters must be correctly encoded (urlencode) in relation to the standard RFC 3986 in order to be admitted by the server.

For example, to consult the event report between the dates 2019-01-01T00:00:00+00:00 y 2019-02-01T00:00:00+00:00:

https://dashboard.360nrs.com/api/rest/sendings/{sendingId}/reports/events?afterDate=2019-01-01T00%3A00%3A00%2B00%3A00&beforeDate=2019-02-01T00%3A00%3A00%2B00%3A00

Get the detailed report of events generated by a campaign. The response will be in text/csv format and will contain the following columns:

For text2speech campaigns: campaignName,campaignId,sendingId,contactId,event,phone,email,landline,countryIso,callDurationSeconds,createdAt

For the other channels: campaignName,campaignId,sendingId,contactId,event,phone,email,landline,countryIso,browser,os,url,createdAt

Keystroke report

Introduction

It returns a report with the telephone numbers together with the key pressed and the voice message.

Url

GET https://dashboard.360nrs.com/api/rest/sendings/<sendingId>/reports/keys

curl -X GET 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys',
  'headers': {
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys"

payload = {}
headers = {
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/sendings/1/reports/keys");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Filters

Parameter Description
beforeDate Show the results previous to the indicated date. The date should be specified in ISO 8601 format.
afterDate Show the results after the indicated date. The date should be specified in ISO 8601 format.

The parameters must be correctly encoded (urlencode) in relation to the standard RFC 3986 in order to be admitted by the server.

For example, to consult the event report between the dates 2019-01-01T00:00:00+00:00 y 2019-02-01T00:00:00+00:00:

https://dashboard.360nrs.com/api/rest/sendings/{sendingId}/reports/keys?afterDate=2019-01-01T00%3A00%3A00%2B00%3A00&beforeDate=2019-02-01T00%3A00%3A00%2B00%3A00

Get the detailed keystrokes report for a voice interactive sending. The response will be in text/csv format and will contain the following columns: phonenumber, key, message

Account

It returns account information such as username, email, time zone, language, balance, creation date, country and currency.

GET https://dashboard.360nrs.com/api/rest/account

curl -X GET 'https://dashboard.360nrs.com/api/rest/account' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dashboard.360nrs.com/api/rest/account',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_AUTH_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpsURLConnection;

public class App {
  public static void main(String[] args) {
    try {
      URL url = new URL("https://dashboard.360nrs.com/api/rest/account");
      HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Authorization", "Basic YOUR_AUTH_TOKEN");
      connection.setRequestProperty("Accept", "application/json");
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String inputLine;
      StringBuffer response = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();
      System.out.println(response.toString());
    } catch (Exception e) {
      // TODO: handle exception
    }
  }
}
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://dashboard.360nrs.com/api/rest/account',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic YOUR_AUTH_TOKEN'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "https://dashboard.360nrs.com/api/rest/account"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic YOUR_AUTH_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://dashboard.360nrs.com/api/rest/account")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic YOUR_AUTH_TOKEN"

response = https.request(request)
puts response.read_body
using System;
using RestSharp;
namespace HelloWorldApplication {
  class HelloWorld {
    static void Main(string[] args) {
      var client = new RestClient("https://dashboard.360nrs.com/api/rest/account");
      client.Timeout = -1;
      var request = new RestRequest(Method.GET);
      request.AddHeader("Authorization", "Basic YOUR_AUTH_TOKEN");
      request.AddHeader("Content-Type", "application/json");
      IRestResponse response = client.Execute(request);
      Console.WriteLine(response.Content);
    }
  }
}

Errors

Error Code HTTP Code Description
0 202 Accepted for delivery
101 500 Internal Database error
102 400 No valid recipients
103 401 Username or password unknown
104 400 Text message missing
105 400 Text message too long
106 400 Sender missing
107 400 Sender too long
108 400 No valid Datetime for send
109 400 Notification URL incorrect
110 400 Exceeded maximum parts allowed or incorrect number of parts
111 402 Not enough credits
112 401 IP address not allowed
113 400 Invalid coding
114 400 Invalid subject
115 400 Sender is not verified
116 400 Invalid replyTo
117 400 ReplyTo is not verified
118 401 Email blocked for exceeding the hard-bounced limit allowed
119 400 Invalid expiration date
120 400 Invalid GUID
121 400 Invalid scheduled date
122 500 Update error
123 500 Delete error
125 400 Invalid JSON
126 400 Empty campaign name
130 400 Invalid voice language
131 400 Invalid voice gender
132 400 Invalid voice caller
133 400 Invalid audio URL
134 400 Unsupported audio format
140 400 Template missing
141 400 Missing landing placeholder
142 400 Can't split variable placeholders
150 400 Missing billing profile
151 400 Error retrieving TPV url
152 400 Invalid VAT
153 400 Invalid method
154 400 Invalid conversion rate
155 400 Max limit reached
156 400 Min limit reached
157 400 Error generating invoice
160 400 Invalid voice interactive language
161 400 Invalid voice interactive gender
162 400 Invalid voice interactive caller
163 400 Invalid voice interactive audio URL
164 400 Unsupported voice interactive audio format
165 400 Invalid voice interactive speech type
166 400 Ivalid voice interactive menu option type
167 400 Trying to save an existing campaign
168 400 Empty speech type
169 400 Empty menu
170 400 Empty phone key
171 400 Phone Key is not a number
172 400 Phone key out of range
173 400 Empty menu options for sub menu
174 400 Empty phone prefix for call transfer
175 400 Empty phone for call transfer
176 400 Call retries value is not an integer
177 400 Call retries value out of range
178 400 Cost limit value is not an integer
179 400 Speech retries value is not an integer
180 400 Speech retries value out of range
181 400 Speech timeout seconds value is not an integer
182 400 Speech timeout seconds value out of range
183 400 Available times value is not an array
184 400 Available times day is not an integer
185 400 Available times day out of range
186 400 Available times from hour format error
187 400 Available times to hour format error
188 400 Available times from hour is greater than to hour
189 400 Missing available time object property
190 400 Call Retries is specified but its value is empty
191 400 Cost limit is specified but its value is empty
192 400 Speech Retries is specified but its value is empty
193 400 Speech timeout seconds is specified but its value is empty
194 400 Available times is specified but its value is empty
195 400 No valid contacts external IDs
196 400 Available times range is too short

Appendix

GSM7 character set

 

0x00

0x10

0x20

0x30

0x40

0x50

0x60

0x70

0x00

@

Δ

SP

0

¡

P

¿

p

0x01

£

_

!

1

A

Q

a

q

0x02

$

Φ

"

2

B

R

b

r

0x03

¥

Γ

#

3

C

S

c

s

0x04

è

Λ

¤

4

D

T

d

t

0x05

é

Ω

%

5

E

U

e

u

0x06

ù

Π

&

6

F

V

f

v

0x07

ì

Ψ

'

7

G

W

g

w

0x08

ò

Σ

(