This guide explains how to authenticate with a token when using the CargoFP API.
1. Obtain Your API Token
You need a token issued by OceanScore to use the CargoFP API. Contact your OceanScore representative to receive it. Get in contact.
2. Choose the API Environment
-
Development (for testing):
https://dev.voyage.emissions.simulator.oceanscore.com/v6/cargo-footprint/ -
Production (for live usage):
https://voyage.emissions.simulator.oceanscore.com/v6/cargo-footprint/
3. Add Required HTTP Headers
Every request must include the following headers:
Authorization: Token <your_token_here>
Content-Type: application/json4. Send an Authenticated Request
Example using Python (requests)
import requests
payload = {
"id": "test-001",
"imo_number": 9647461,
"departure_port": "ESBCN",
"arrival_port": "JPNGO",
"cargo_weight_mt": 20.0,
"cargo_reefer": True
}
headers = {
"Authorization": "Token YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
response = requests.post(
"https://voyage.emissions.simulator.oceanscore.com/v6/cargo-footprint/",
headers=headers,
json=payload
)
print(response.json())
5. Token Rotation
Tokens do not expire but can be rotated upon request. Contact OceanScore if your token needs to be reset.
