Notification

The R+L Carriers Notification API is a robust system for creating and managing push notifications. All shipment tracing and document data related notifications are available.
Add Group Notification
HTTP Method: POST
URL: /GroupNotification
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for. Accepted Values: Shipment, Document
GroupName string One Required Name of the Group Notification. This name should be unique for the same user
Parties array One Required List of parties that you want to get notifications
Properties
Party string One or More Required Accepted values: BillTo, ShipFrom, ShipTo
AccountCodes array One Required List of account codes that you want to get notifications
Properties
AccountCode string One or More Required User account codes
AllAccountCodes boolean One Required Flag to signup for all account codes
Events array One Required List of events that will trigger the notification
Properties
Event string One or More Required Accepted values: PickedUp, Departed, ArrivedAt, OutForDelivery, Delivered
Emails array One Required List of Emails that will get the notification
Properties
Email string One or More Required Email Address
Urls array One Optional List of Urls that you want the notification to be pushed to
Properties
Url object Zero or More Optional Url object
Properties
Value string One Required Url Address
UserDefinedField1 string Zero or One Optional User Defined Field 1
UserDefinedField2 string Zero or One Optional User Defined Field 2
UserDefinedField3 string Zero or One Optional User Defined Field 3
Response Parameters
Name Type Cardinality Description
NotificationGroupID integer One Newly created group notification Id
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/GroupNotification');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "NotificationType": "Shipment",
\n "GroupName": "Your Group Name",
\n "Parties": [
\n "ShipFrom"
\n ],
\n "AccountCodes": [
\n "123456"
\n ],
\n "AllAccountCodes": false,
\n "Events": [
\n "OutForDelivery"
\n ],
\n "Emails": [
\n "email@youorg.com"
\n ],
\n "Urls": [
\n {
\n "Value": "Your Url",
\n "UserDefinedField1": "User DefinedField 1",
\n "UserDefinedField2": "User DefinedField 2",
\n "UserDefinedField3": "User DefinedField 3"
\n }
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public SaveGroupNotificationResponse AddGroupNotification()
{
var request = PopulateAddGroupNotificationData();

var response = new SaveGroupNotificationResponse();

var url = "{baseurl}/GroupNotification";

using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PostAsJsonAsync(url, request).Result;

response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}

private AddGroupNotificationRequest PopulateAddGroupNotificationData()
{
var url = new Url
{
Value = "Your Url",
UserDefinedField1 = "User DefinedField 1",
UserDefinedField2 = "User DefinedField 2",
UserDefinedField3 = "User DefinedField 3"
};

var request = new AddGroupNotificationRequest
{
NotificationType = "Shipment",
GroupName = "test insert",
Parties = new string[] { "ShipFrom" },
AccountCodes = new string[] { "123456" },
Events = new string[] { "OutForDelivery" },
Emails = new string[] { "email@youorg.com" },
Urls = new Url[] { url }
};

return request;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public SaveGroupNotificationResponse AddGroupNotification() throws Exception{
SaveGroupNotificationResponse response = new SaveGroupNotificationResponse();

AddGroupNotificationRequest request = PopulateAddGroupNotificationData();
String requestJSON = mapper.writeValueAsString(request);

String url = "{baseurl}/GroupNotification";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpRequest = new HttpPost(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);

BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}

response = mapper.readValue(result.toString(), SaveGroupNotificationResponse.class);

return response;
}

private AddGroupNotificationRequest PopulateAddGroupNotificationData()
{
Url url = new Url();
url.Value = "Your Url";
url.UserDefinedField1 = "User DefinedField 1";
url.UserDefinedField2 = "User DefinedField 2";
url.UserDefinedField3 = "User DefinedField 3";

AddGroupNotificationRequest request = new AddGroupNotificationRequest();
request.NotificationType = "Shipment";
request.GroupName = "Your Group Name";
request.Parties = new String[] { "ShipFrom" };
request.AccountCodes = new String[] { "123456" };
request.Events = new String[] { "OutForDelivery" };
request.Emails = new String[] { "email@youorg.com" };
request.Urls = new Url[] { url };

return request;
}
}
Edit Group Notification
HTTP Method: PUT
URL: /GroupNotification
Request Parameters
Name Type Cardinality Required Description
NotificationGroupID integer One Required Notification group Id
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
GroupName string One Required Name of the Group Notification. This name should be unique for the same user
Parties array One Required List of parties that you want to get notifications
Properties
Party string One or More Required Accepted values: BillTo, ShipFrom, ShipTo
AccountCodes array One Required List of account codes that you want to get notifications
Properties
AccountCode string One Required User account code
AllAccountCodes boolean One Required Flag to signup for all account codes
Events array One Required List of events that will trigger the notification
Properties
Event string One or More Required Accepted values: PickedUp, OutForDelivery, Delivered
Emails array One Required List of Emails that will get the notification
Properties
Email string One or More Required Email Address
Urls array Zero or One Optional List of Urls that you want the notification to be pushed to
Properties
Url object Zero or More Optional
Properties
Value string One Required Url Address
UserDefinedField1 string Zero or One Optional User Defined Field 1
UserDefinedField2 string Zero or One Optional User Defined Field 2
UserDefinedField3 string Zero or One Optional User Defined Field 3
Response Parameters
Name Type Cardinality Description
NotificationGroupID integer One Group notification Id
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/GroupNotification');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "NotificationGroupID": 1,
\n "NotificationType": "Shipment",
\n "GroupName": "Your Group Name",
\n "Parties": [
\n "ShipTo"
\n ],
\n "AccountCodes": [
\n "123456"
\n ],
\n "AllAccountCodes": false,
\n "Events": [
\n "Delivered"
\n ],
\n "Emails": [
\n "email@youorg.com"
\n ],
\n "Urls": [
\n {
\n "Value": "Your Url",
\n "UserDefinedField1": "User DefinedField 1",
\n "UserDefinedField2": "User DefinedField 2",
\n "UserDefinedField3": "User DefinedField 3"
\n }
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public SaveGroupNotificationResponse EditGroupNotification()
{
var request = PopulateEditGroupNotificationData();

var response = new SaveGroupNotificationResponse();

var url = "{baseurl}/GroupNotification";

using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PutAsJsonAsync(url, request).Result;

response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}

private EditGroupNotificationRequest PopulateEditGroupNotificationData()
{
var url = new Url
{
Value = "Your Url",
UserDefinedField1 = "User DefinedField 1",
UserDefinedField2 = "User DefinedField 2",
UserDefinedField3 = "User DefinedField 3"
};

var request = new EditGroupNotificationRequest
{
NotificationGroupID = 1,
NotificationType = "Shipment",
Parties = new string[] { "ShipFrom" },
AccountCodes = new string[] { "123456" },
Events = new string[] { "OutForDelivery" },
Emails = new string[] { "email@youorg.com" },
Urls = new Url[] { url }
};

return request;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public SaveGroupNotificationResponse EditGroupNotification() throws Exception{
SaveGroupNotificationResponse response = new SaveGroupNotificationResponse();

EditGroupNotificationRequest request = PopulateEditGroupNotificationData();
String requestJSON = mapper.writeValueAsString(request);

String url = "{baseurl}/GroupNotification";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPut httpRequest = new HttpPut(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);

BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}

response = mapper.readValue(result.toString(), SaveGroupNotificationResponse.class);

return response;
}

private EditGroupNotificationRequest PopulateEditGroupNotificationData()
{
Url url = new Url();
url.Value = "Your Url";
url.UserDefinedField1 = "User DefinedField 1";
url.UserDefinedField2 = "User DefinedField 2";
url.UserDefinedField3 = "User DefinedField 3";

EditGroupNotificationRequest request = new EditGroupNotificationRequest();
request.NotificationGroupID = 1;
request.NotificationType = "Shipment";
request.GroupName = "Your Group Name";
request.Parties = new String[] { "ShipFrom" };
request.AccountCodes = new String[] { "123456" };
request.Events = new String[] { "OutForDelivery" };
request.Emails = new String[] { "email@youorg.com" };
request.Urls = new Url[] { url };

return request;
}
}
SaveProNotification
HTTP Method: PUT
URL: /ProNotification
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
ProNumber string One Required Either the web pro, universal pro, or pro. Web Pros start with 'W', and Universal Pros start with 'A'.
Events array One Required List of events that will trigger the notification
Properties
Event string One or More Required Accepted values: PickedUp, OutForDelivery, Delivered
Emails array One Required List of Emails that will get the notification
Properties
Email string One or More Required Email Address
Urls array Zero or One Optional List of Urls that you want the notification to be pushed to
Properties
Url object Zero or More Optional
Properties
Value string One Required Url Address
UserDefinedField1 string Zero or One Optional User Defined Field 1
UserDefinedField2 string Zero or One Optional User Defined Field 2
UserDefinedField3 string Zero or One User Defined Field 3
Response Parameters
Name Type Cardinality Description
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/ProNotification');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "NotificationType": "Shipment",
\n "ProNumber": "I111111111",
\n "Events": [
\n "OutForDelivery"
\n ],
\n "Emails": [
\n "email@youorg.com"
\n ],
\n "Urls": [
\n {
\n "Value": "Your Url",
\n "UserDefinedField1": "User DefinedField 1",
\n "UserDefinedField2": "User DefinedField 2",
\n "UserDefinedField3": "User DefinedField 3"
\n }
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public ApiResponse SaveProNotification()
{
var request = PopulateSaveProNotificationData();

var response = new ApiResponse();

var url = "{baseurl}/ProNotification";

using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PutAsJsonAsync(url, request).Result;

response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}

private SaveProNotificationRequest PopulateSaveProNotificationData()
{
var url = new Url
{
Value = "Your Url",
UserDefinedField1 = "User DefinedField 1",
UserDefinedField2 = "User DefinedField 2",
UserDefinedField3 = "User DefinedField 3"
};

var request = new SaveProNotificationRequest
{
NotificationType = "Shipment",
ProNumber = "I111111111",
Events = new string[] { "OutForDelivery" },
Emails = new string[] { "email@youorg.com" },
Urls = new Url[] { url }
};

return request;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public ApiResponse SaveProNotification() throws Exception{
ApiResponse response = new ApiResponse();

SaveProNotificationRequest request = PopulateSaveProNotificationData();
String requestJSON = mapper.writeValueAsString(request);

String url = "{baseurl}/ProNotification";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPut httpRequest = new HttpPut(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);

BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}

response = mapper.readValue(result.toString(), ApiResponse.class);

return response;
}

private SaveProNotificationRequest PopulateSaveProNotificationData()
{
Url url = new Url();
url.Value = "Your Url";
url.UserDefinedField1 = "User DefinedField 1";
url.UserDefinedField2 = "User DefinedField 2";
url.UserDefinedField3 = "User DefinedField 3";

SaveProNotificationRequest request = new SaveProNotificationRequest();
request.NotificationType = "Shipment";
request.ProNumber = "I111111111";
request.Events = new String[] { "OutForDelivery" };
request.Emails = new String[] { "email@youorg.com" };
request.Urls = new Url[] { url };

return request;
}
}
Get User Account Codes
HTTP Method: GET
URL: /UserAccountCodes
Response Parameters
Name Type Cardinality Description
AccountCodes array One List of the user account codes
Properties
AccountCode string One or More Account code
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/UserAccountCodes');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public GetUserAccountCodesResponse GetUserAccountCodes()
{
var url = "{baseurl}/UserAccountCodes";

var response = new GetUserAccountCodesResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public GetUserAccountCodesResponse GetUserAccountCodes() throws Exception {
GetUserAccountCodesResponse response = new GetUserAccountCodesResponse();

String url = "{baseurl}/UserAccountCodes";

HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);

HttpResponse httpResponse = httpClient.execute(httprequest);

BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

String inputLine;
StringBuffer result = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();

response = mapper.readValue(result.toString(), GetUserAccountCodesResponse.class);

return response;
}
}
Get All Group Notifications
HTTP Method: GET
URL: /GroupNotifications
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
Response Parameters
Name Type Cardinality Description
Groups array One List of Notification Groups
Properties
Group object Zero or More
Properties
ID integer One Notification Group Id
Name string One Notification Group Name
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/GroupNotifications?NotificationType=Shipment');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public GetGroupNotificationsResponse GetGroupNotifications(string notificationType)
{
var url = string.Format("{baseurl}/GroupNotifications?NotificationType={0}", notificationType);

var response = new GetGroupNotificationsResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public GetGroupNotificationsResponse GetGroupNotifications(String notificationType) throws Exception {
GetGroupNotificationsResponse response = new GetGroupNotificationsResponse();

String url = "{baseurl}/GroupNotifications?NotificationType=" + notificationType;

HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);

HttpResponse httpResponse = httpClient.execute(httprequest);

BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

String inputLine;
StringBuffer result = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();

response = mapper.readValue(result.toString(), GetGroupNotificationsResponse.class);

return response;
}
}
Get Group Notification Details
HTTP Method: GET
URL: /GroupNotification
Request Parameters
Name Type Cardinality Required Description
NotificationGroupID integer One Required Notification group Id
Response Parameters
Name Type Cardinality Description
GroupDetails object One
Properties
ID integer One Notification Group Id
Name string One Notification Group Name
Parties array One List of parties that will get notifications
Properties
Party string One or More
AccountCodes array One List of account codes that will get notifications
Properties
AccountCode string One or More User account code
AllAccountCodes boolean One Flag to signup all account codes for the user to get notifications
Events array One List of events that will trigger the notification
Properties
Event string One or More
Emails array One List of Emails that will get the notification
Properties
Email string One or More Email Address
Urls array Zero or One List of Urls that you want the notification to be pushed to
Properties
Url object Zero or More
Properties
Value string One Url Address
UserDefinedField1 string Zero or One User Defined Field 1
UserDefinedField2 string Zero or One User Defined Field 2
UserDefinedField3 string Zero or One User Defined Field 3
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/GroupNotification?NotificationGroupID=1');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public GetGroupNotificationDetailsResponse GetGroupNotificationDetails(int groupID)
{
var url = string.Format("{baseurl}/GroupNotification?NotificationGroupID={0}", groupID.ToString());

var response = new GetGroupNotificationDetailsResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public GetGroupNotificationDetailsResponse GetGroupNotificationDetails(int groupID) throws Exception {
GetGroupNotificationDetailsResponse response = new GetGroupNotificationDetailsResponse();

String url = "{baseurl}/GroupNotification?NotificationGroupID=" + groupID;

HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);

HttpResponse httpResponse = httpClient.execute(httprequest);

BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

String inputLine;
StringBuffer result = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();

response = mapper.readValue(result.toString(), GetGroupNotificationDetailsResponse.class);

return response;
}
}
Get All Pro Notifications
HTTP Method: GET
URL: /ProNotifications
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
Response Parameters
Name Type Cardinality Description
ProNumbers array One List of Pro Numbers the user signed up to get notifications for.
Properties
ProNumber string Zero or More Either the web pro, universal pro, or pro. Web Pros start with 'W', and Universal Pros start with 'A'.
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/ProNotifications?NotificationType=Shipment');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public GetProNotificationsResponse GetProNotifications(string notificationType)
{
var url = string.Format("{baseurl}/ProNotifications?NotificationType={0}", notificationType);

var response = new GetProNotificationsResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public GetProNotificationsResponse GetProNotifications(String notificationType) throws Exception {
GetProNotificationsResponse response = new GetProNotificationsResponse();

String url = "{baseurl}/ProNotifications?NotificationType=" + notificationType;

HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);

HttpResponse httpResponse = httpClient.execute(httprequest);

BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

String inputLine;
StringBuffer result = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();

response = mapper.readValue(result.toString(), GetProNotificationsResponse.class);

return response;
}
}
Get Pro Notification Details
HTTP Method: GET
URL: /ProNotification
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
ProNumber string One Required Either the web pro, universal pro, or pro. Web Pros start with 'W', and Universal Pros start with 'A'.
Response Parameters
Name Type Cardinality Description
Events array One List of events that will trigger the notification
Properties
Event string One or More
Emails array One List of Emails that will get the notification
Properties
Email string One or More Email Address
Urls array Zero or One List of Urls that you want the notification to be pushed to
Properties
Url object Zero or More
Properties
Value string One
UserDefinedField1 string Zero or One User Defined Field 1
UserDefinedField2 string Zero or One User Defined Field 2
UserDefinedField3 string Zero or One User Defined Field 3
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/ProNotification?NotificationType=Shipment&ProNumber=I111111111');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public GetProNotificationDetailsResponse GetProNotificationDetails(string notificationType, string proNumber)
{
var url = string.Format("{baseurl}/ProNotification?NotificationType={0}&ProNumber={1}", notificationType, proNumber);

var response = new GetProNotificationDetailsResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public GetProNotificationDetailsResponse GetProNotificationDetails(String notificationType, String proNumber) throws Exception {
GetProNotificationDetailsResponse response = new GetProNotificationDetailsResponse();

String url = "{baseurl}/ProNotification?NotificationType=" + notificationType + "&ProNumber=" + proNumber;

HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);

HttpResponse httpResponse = httpClient.execute(httprequest);

BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));

String inputLine;
StringBuffer result = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();

response = mapper.readValue(result.toString(), GetProNotificationDetailsResponse.class);

return response;
}
}
Delete Group Notification
HTTP Method: DELETE
URL: /GroupNotification
Request Parameters
Name Type Cardinality Required Description
NotificationGroupID string
Response Parameters
Name Type Cardinality Description
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/GroupNotification');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "NotificationGroupID": 1
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public ApiResponse DeleteGroupNotification(int groupID)
{
var request = new DeleteGroupNotificationRequest()
{
NotificationGroupID = groupID
};

var requestJSON = JsonConvert.SerializeObject(request);

HttpRequestMessage httpRequest = new HttpRequestMessage
{
Content = new StringContent(requestJSON, Encoding.UTF8, "application/json"),
Method = HttpMethod.Delete,
RequestUri = new Uri("{baseurl}/GroupNotification")
};

var response = new ApiResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
var apiResponse = client.SendAsync(httpRequest).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public ApiResponse DeleteGroupNotification(int groupID) throws Exception{
ApiResponse response = new ApiResponse();

DeleteGroupNotificationRequest request = new DeleteGroupNotificationRequest();
request.NotificationGroupID = groupID;
String requestJSON = mapper.writeValueAsString(request);

String url = "{baseurl}/GroupNotification";

HttpClient httpClient = HttpClientBuilder.create().build();
HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(url);
StringEntity params =new StringEntity(requestJSON);
httpDelete.addHeader("content-type", "application/json");
httpDelete.addHeader("apiKey", apiKey);
httpDelete.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpDelete);

HttpEntity entity = httpResponse.getEntity();
String responseString = EntityUtils.toString(entity);

response = mapper.readValue(responseString, ApiResponse.class);

return response;
}
}


class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
public static final String METHOD_NAME = "DELETE";

public String getMethod() {
return METHOD_NAME;
}

public HttpDeleteWithBody(final String uri) {
super();
setURI(URI.create(uri));
}

public HttpDeleteWithBody(final URI uri) {
super();
setURI(uri);
}

public HttpDeleteWithBody() {
super();
}
}
Delete Pro Notification
HTTP Method: DELETE
URL: /ProNotification
Request Parameters
Name Type Cardinality Required Description
NotificationType string One Required The Notification Type you want to signup for
Accepted Values: Shipment, Document
ProNumber string One Required Either the web pro, universal pro, or pro. Web Pros start with 'W', and Universal Pros start with 'A'.
Response Parameters
Name Type Cardinality Description
Code integer One HTTP status code
Errors array One Returned errors
Properties
Error object Zero or More
Properties
Property string One
ErrorMessage string One
ExceptionMessage string One
Messages array One Returned informational messages
Properties
Message string Zero or More

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/ProNotification');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "NotificationType": "Shipment",
\n "ProNumber": "I111111111"
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts;
using CallAPI.DataContracts.Notification;
using CallAPI.DataContracts.Notification.Request;
using CallAPI.DataContracts.Notification.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace CallAPI
{
class NotificationSample
{
string apiKey = "Your API Key";

public ApiResponse DeleteProNotification(string notificationType, string proNumber)
{
var request = new DeleteProNotificationRequest()
{
NotificationType = notificationType,
ProNumber = proNumber
};

var requestJSON = JsonConvert.SerializeObject(request);

HttpRequestMessage httpRequest = new HttpRequestMessage
{
Content = new StringContent(requestJSON, Encoding.UTF8, "application/json"),
Method = HttpMethod.Delete,
RequestUri = new Uri("{baseurl}/ProNotification")
};

var response = new ApiResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
var apiResponse = client.SendAsync(httpRequest).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}

return response;
}
}
}
package Samples;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import DataContracts.ApiResponse;
import DataContracts.Notification.Url;
import DataContracts.Notification.Request.AddGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteGroupNotificationRequest;
import DataContracts.Notification.Request.DeleteProNotificationRequest;
import DataContracts.Notification.Request.EditGroupNotificationRequest;
import DataContracts.Notification.Request.SaveProNotificationRequest;
import DataContracts.Notification.Response.GetGroupNotificationDetailsResponse;
import DataContracts.Notification.Response.GetGroupNotificationsResponse;
import DataContracts.Notification.Response.GetProNotificationDetailsResponse;
import DataContracts.Notification.Response.GetProNotificationsResponse;
import DataContracts.Notification.Response.GetUserAccountCodesResponse;
import DataContracts.Notification.Response.SaveGroupNotificationResponse;

public class NotificationSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();

public ApiResponse DeleteProNotification(String notificationType, String proNumber) throws Exception{
ApiResponse response = new ApiResponse();

DeleteProNotificationRequest request = new DeleteProNotificationRequest();
request.NotificationType = notificationType;
request.ProNumber = proNumber;
String requestJSON = mapper.writeValueAsString(request);

String url = "{baseurl}/ProNotification";

HttpClient httpClient = HttpClientBuilder.create().build();
HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(url);
StringEntity params =new StringEntity(requestJSON);
httpDelete.addHeader("content-type", "application/json");
httpDelete.addHeader("apiKey", apiKey);
httpDelete.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpDelete);

HttpEntity entity = httpResponse.getEntity();
String responseString = EntityUtils.toString(entity);

response = mapper.readValue(responseString, ApiResponse.class);

return response;
}
}


class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
public static final String METHOD_NAME = "DELETE";

public String getMethod() {
return METHOD_NAME;
}

public HttpDeleteWithBody(final String uri) {
super();
setURI(URI.create(uri));
}

public HttpDeleteWithBody(final URI uri) {
super();
setURI(uri);
}

public HttpDeleteWithBody() {
super();
}
}