Credentials
The Credentials resource allows users to store their own carrier account secrets securely. This gives users the ability to reuse their credentials without providing actual secret values in every single shipment request. There can be multiple secret values stored in a single credential resource.
Scope: read_credentials, write_credentials
Note: Supported carriers and parameters can be found in Carrier Parameters page.
Note: All secret
params
that are stored by BoxC are encrypted at the storage layer using the Advanced Encryption Standard (AES) algorithm — AES-256
.Important: Once a credential resource is created, it is not possible to see the secret values for security reasons.
Important: If the secret values have to be updated for any reason, we recommend updating your existing Credential resource instead of creating a new one. Doing so will ensure that secret values are always up to date for previously created labels with the same Credential resource and event tracking is not affected adversely.
Actions
GET /credentials |
Retrieves a paginated list of credentials |
GET /credentials/{id} |
Retrieves a credential |
POST /credentials |
Creates a credential |
PUT /credentials/{id} |
Updates a credential |
DELETE /credentials/{id} |
Deletes a credential |
Properties
carrier |
|
created |
|
deleted |
|
id |
|
params |
{ "params": { "cig_username": "", "cig_password": "", "client_id": "", "client_secret": "" } } Object - The final mile carrier specific secret values. Supported parameters can be found on the Carrier Parameters page. |
user_id |
|
updated |
|
GET
/credentials
Retrieves a list of credentials
limit |
The number of results to return. Max: 250. Default: 50. |
order |
The order of the results. Options are "asc" for ascending, or "desc" (default) for descending. |
page_token |
Used for selecting the page after the initial query. |
sort |
The property to sort by. Options are "id" (default) or "carrier". |
request
GET /credentials
limit=2&order=desc&sort=id
response
HTTP/1.1 200 OK
{ "credentials": [ { "id": 1234567, "user_id": 123456, "carrier": "DeutschePost", "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" }, "updated": "2023-11-28 12:51:52", "created": "2023-11-28 12:51:52", "deleted": false }, { "id": 1234566, "user_id": 123456, "carrier": "PostNL", "params": { "customer_code": "", "customer_number": "" }, "updated": "2023-11-28 12:51:38", "created": "2023-11-28 12:51:38", "deleted": false }, { "...": "..." } ], "next_page": "bGltaXQ9NTAmb3JkZXI9ZGVzYyZwYWdlPTEmc29ydD1pZCZsYXN0X2lkPTI0NDEzMQ==" }
GET
/credentials/{id}
Retrieves a credential
request
GET /credentials/1234567
response
HTTP/1.1 200 OK
{ "credential": { "id": 1234567, "user_id": 123456, "carrier": "DeutschePost", "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" }, "updated": "2023-11-28 10:40:00", "created": "2023-11-28 10:40:00", "deleted": false } }
POST
/credentials
Creates a credential
request
POST /credentials
{ "credential": { "carrier": "DHLeC", "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" } } }
response
HTTP/1.1 201 Created
{ "credential": { "id": 1234567, "user_id": 123456, "carrier": "DHLeC", "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" }, "updated": "2023-11-28 12:51:52", "created": "2023-11-28 12:51:52", "deleted": false } }
PUT
/credentials/{id}
Updates a credential
- Only the
params
property can be updated. - New
params
object willreplace
the old one. Changing value of a single param is not possible. Make sure you provide all the values even if you are not updating their values.
request
PUT /credentials/1946
{ "credential": { "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" } } }
response
HTTP/1.1 200 OK
{ "credential": { "id": 1234567, "user_id": 123456, "carrier": "DHLeC", "params": { "ekp": "", "cig_password": "", "cig_username": "", "tnt_password": "", "tnt_username": "", "retoure_password": "", "retoure_username": "", "contract_participation": "", "gkp_username": "", "gkp_password": "", "dp_api_key": "" }, "updated": "2023-11-28 13:00:00", "created": "2023-11-28 12:51:52", "deleted": false } }
DELETE
/credentials/{id}
Deletes a credential
request
DELETE /credentials/1234567
response
HTTP/1.1 200 OK