CloudSignal API

This documentation describes the CloudSignal API v1.1

This version of the protocol has been depricated - Please upgrade to version 2.0.


Getting started

To get started with Cloudprinter as a Print Partner please read the "Getting started as a Print Partner" article.

Online sign up as a Print Partner is found here: Sign up as Print Partner


Basics

RESTful API

The CloudSignal API is RESTful. All API calls are implemented as HTTP post requests.

Request Data

All request data posted to the API must be in JSON objects. The documentation for each API call describes the request data parameters in detail.

Return Data

In case on a HTTP response code 400 the return data can contain an error message. In all other cases the return data is not used.

HTTP response code

The HTTP response code 200 is a positive responses, all other response codes must be considered as error.

Content-type

Set content-type to application/json on all requests.

Authentication

Authentication on the CloudSignal API is done via the API key. The API key is generated by the Cloudprinter system when you create the CloudSignal API Interface in the admin panel.

Please note: The API key for signals is not the same API key as for incoming orders.


Signal types

OrderRegistered: https://api.cloudprinter.com/1.1/status/

endpoint
https://api.cloudprinter.com/1.1/status/

Order received and accepted by the production.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "OrderRegistered",
    "order": "123456780000",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "OrderRegistered",
    "order": "123456780000",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudsignal/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/cloudsignal/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "OrderRegistered",
    "order": "123456780000",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/cloudsignal/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "OrderRegistered",
    "order": "123456780000",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/cloudsignal/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "OrderRegistered",
    "order": "123456780000",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: OrderRegisteredrequired
orderstringthe full order idrequired
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemProduce:

endpoint
https://api.cloudprinter.com/1.1/status/

Production has started for item.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduce",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduce",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduce",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduce",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduce",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemProducerequired
orderstringthe full order idrequired
itemstringthe full item idrequired
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemProduced:

endpoint
https://api.cloudprinter.com/1.1/status/

Production completed for item.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduced",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduced",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduced",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduced",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemProduced",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemProducedrequired
orderstringthe full order idrequired
itemstringthe full item idrequired
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemPacked: https://api.cloudprinter.com/1.1/status/\

endpoint
https://api.cloudprinter.com/1.1/status/

Item has been packed.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemPacked",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemPacked",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemPacked",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemPacked",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemPacked",
    "order": "123456780000",
    "item": "123456780001",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemPackedrequired
orderstringthe full order idrequired
itemstringthe full item idrequired
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemShipped:

endpoint
https://api.cloudprinter.com/1.1/status/

Item has been shipped. The tracking code for the packet is included in this signal.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemShipped",
    "order": "123456780000",
    "item": "123456780001",
    "tracking": "1A2B3C4D5E6F",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemShipped",
    "order": "123456780000",
    "item": "123456780001",
    "tracking": "1A2B3C4D5E6F",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemShipped",
    "order": "123456780000",
    "item": "123456780001",
    "tracking": "1A2B3C4D5E6F",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemShipped",
    "order": "123456780000",
    "item": "123456780001",
    "tracking": "1A2B3C4D5E6F",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemShipped",
    "order": "123456780000",
    "item": "123456780001",
    "tracking": "1A2B3C4D5E6F",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemShippedrequired
orderstringthe full order idrequired
itemstringthe full item idrequired
trackingstringtracking code for the itemrequired
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemError:

endpoint
https://api.cloudprinter.com/1.1/status/

Item has problem or error. This could be due print error or failed in quality check etc.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemError",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "Print error, reprint needed",
    "delay": "24",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemError",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "Print error, reprint needed",
    "delay": "24",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemError",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "Print error, reprint needed",
    "delay": "24",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemError",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "Print error, reprint needed",
    "delay": "24",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemError",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "Print error, reprint needed",
    "delay": "24",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemErrorrequired
orderstringthe full order idrequired
itemstringthe full item idrequired
causestringtext string explaning the erroroptional
delaystringexpected delay in hoursoptional
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed

ItemCanceled:

endpoint
https://api.cloudprinter.com/1.1/status/

Item has been canceled.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemCanceled",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "190",
    "message": "Example message",
    "datetime": "2016-01-20 13:00:00 GMT"
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemCanceled",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "190",
    "message": "Example message",
    "datetime": "2016-01-20 13:00:00 GMT"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/1.1/status/',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/1.1/status/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemCanceled",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "190",
    "message": "Example message",
    "datetime": "2016-01-20 13:00:00 GMT"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/1.1/status/"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemCanceled",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "190",
    "message": "Example message",
    "datetime": "2016-01-20 13:00:00 GMT"
}
)
headers = {
  'Content-Type': 'application/json'
}

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

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/1.1/status/' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "type": "ItemCanceled",
    "order": "123456780000",
    "item": "123456780001",
    "cause": "190",
    "message": "Example message",
    "datetime": "2016-01-20 13:00:00 GMT"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringapi access keyrequired
typestringvalid value: ItemCanceledrequired
orderstringthe full order idrequired
itemstringthe full item idrequired
causestringcauseoptional
messagestringmessageoptional
delaystringexpected delay in hoursoptional
datetimestringtimestamprequired
CodeStatusDescription
200OKthe request has succeeded
400Bad requestthe request was invalid or parameters are missing
401Unauthorizedauthentication failed
403Forbiddenauthentication failed