shipping.nc API

Notification settings

Server

Get notification settings

GET
https://api.shipping.nc
/v1/settings/notifications

Senders, their verification state, the SMS price and which events send an SMS or an email. Allowed to carrier admins only.

Get notification settings › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Get notification settings › Responses

The settings.

sms_sender_name
​string | null · pattern: ^[A-Za-z0-9]{1,11}$ · required
sms_sender_status
​string · enum · required
Enum values:
not_set
pending
verified
failed
email_from_address
​string | null · email · pattern: ^(?:[A-Za-z0-9_'+\-]… · required
email_domain_status
​string · enum · required
Enum values:
not_set
pending
verified
failed
sms_price_per_segment_xpf
​integer | null · min: 0 · max: 9007199254740991 · required

null until the SMS provider and its price are decided.

​object[] · minItems: 7 · maxItems: 7 · required

Choose which events notify recipients

PUT
https://api.shipping.nc
/v1/settings/notifications/rules

Events left out keep their rule. The pickup code SMS stays on. Allowed to carrier admins only.

Choose which events notify recipients › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Choose which events notify recipients › Request Body

​object[] · minItems: 1 · required

Choose which events notify recipients › Responses

Every rule.

​object[] · required

Set the SMS sender name and the sending email

PUT
https://api.shipping.nc
/v1/settings/notifications/senders

Allowed to carrier admins only.

Set the SMS sender name and the sending email › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Set the SMS sender name and the sending email › Request Body

sms_sender_name
​string | null · pattern: ^[A-Za-z0-9]{1,11}$ · required
email_from_address
​string | null · email · pattern: ^(?:[A-Za-z0-9_'+\-]… · required

Set the SMS sender name and the sending email › Responses

Saved.

No data returned

Get a message template

GET
https://api.shipping.nc
/v1/settings/notifications/templates/{event}/{channel}

The carrier's template, or the shipping.nc default when none is saved. Allowed to carrier admins only.

Get a message template › path Parameters

event
​string · required

The event that sends the message.

channel
​string · required

sms or email.

Get a message template › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Get a message template › Responses

The template.

event
​string · enum · required
Enum values:
shipment_created
picked_up
out_for_delivery
pickup_code
delivery_failed
delivered
returned_to_sender
channel
​string · enum · required
Enum values:
sms
email
subject
​string | null · required
body
​string · required
is_default
​boolean · required

Save a message template

PUT
https://api.shipping.nc
/v1/settings/notifications/templates/{event}/{channel}

An email needs a subject, an SMS none. Only the variables of the event are allowed. Allowed to carrier admins only.

Save a message template › path Parameters

event
​string · required

The event that sends the message.

channel
​string · required

sms or email.

Save a message template › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Save a message template › Request Body

subject
​string | null · minLength: 1 · maxLength: 200 · required
body
​string · minLength: 1 · maxLength: 1000 · required

Save a message template › Responses

The saved template.

event
​string · enum · required
Enum values:
shipment_created
picked_up
out_for_delivery
pickup_code
delivery_failed
delivered
returned_to_sender
channel
​string · enum · required
Enum values:
sms
email
subject
​string | null · required
body
​string · required
is_default
​boolean · required

Restore the default template

DELETE
https://api.shipping.nc
/v1/settings/notifications/templates/{event}/{channel}

Allowed to carrier admins only.

Restore the default template › path Parameters

event
​string · required

The event that sends the message.

channel
​string · required

sms or email.

Restore the default template › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Restore the default template › Responses

The default template.

event
​string · enum · required
Enum values:
shipment_created
picked_up
out_for_delivery
pickup_code
delivery_failed
delivered
returned_to_sender
channel
​string · enum · required
Enum values:
sms
email
subject
​string | null · required
body
​string · required
is_default
​boolean · required

Send a test message

POST
https://api.shipping.nc
/v1/settings/notifications/templates/{event}/{channel}/test

Fills the given template with sample data and sends it to the carrier's contact phone or support email. While no SMS provider is chosen, the message is only logged and delivered is false. Allowed to carrier admins only.

Send a test message › path Parameters

event
​string · required

The event that sends the message.

channel
​string · required

sms or email.

Send a test message › Headers

x-correlation-id
​string · maxLength: 128

Your request identifier. Generated when absent, and always echoed in the response header.

Send a test message › Request Body

subject
​string | null · minLength: 1 · maxLength: 200 · required
body
​string · minLength: 1 · maxLength: 1000 · required

Send a test message › Responses

The test is on its way.

channel
​string · enum · required
Enum values:
sms
email
sent_to
​string · required

The phone or email of the carrier contact the test went to.

delivered
​boolean · required

false while the channel has no provider: the test was only logged.