Skip to content

Carbon Calculator

All operations require authentication.

6 operationsv1/me/carbonCalculator
Agent setup

Create a carbon footprint csv generation taskProduction

POST
/1.0/me/carbonCalculator/csv

Request body (required)

endMonth
required
stringdate

End month of computation. Must be after start month. Only year and month are used; the day is ignored.

startMonth
required
stringdate

Start month of computation. Must be before end month. Only year and month are used; the day is ignored.

Response

200CalculationResponsesuccessful operation
taskID
read-only
string

ID of the calculation task

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/csv \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "taskID": "string"}

Find out if the account has data to generate invoiceProduction

GET
/1.0/me/carbonCalculator/hasInvoice

Query parameters

date
stringdate

Month of the requested invoice (day is ignored)

Response

200HasInvoiceResponsesuccessful operation
hasInvoice
read-only
boolean

Whether the account has data to generate invoice

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/hasInvoice \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "hasInvoice": true}

Create a carbon footprint pdf generation taskProduction

POST
/1.0/me/carbonCalculator/pdf

Request body (required)

month
required
stringdate

Month of computation. Must be between last month and last month - 24 months. Only year and month are used; the day is ignored

Response

200CalculationResponsesuccessful operation
taskID
read-only
string

ID of the calculation task

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/pdf \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "taskID": "string"}

List all tasksProduction

GET
/1.0/me/carbonCalculator/task

Response

200Task[]successful operation
link
read-only
string

Link to the document

status
read-only
TaskStatusEnum

Status of the task

ValuesERRORIN_PROGRESSSUCCESS
taskID
read-only
string

ID of the task

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/task \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "link": "string", "status": "ERROR", "taskID": "string" }]

Create a carbon footprint generation taskProduction

POST
/1.0/me/carbonCalculator/task

Request body (required)

date
required
stringdate

Month of the requested document (day is ignored)

Response

200CalculationResponsesuccessful operation
taskID
read-only
string

ID of the calculation task

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/task \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "taskID": "string"}

Fetch a task by its IDProduction

GET
/1.0/me/carbonCalculator/task/{taskID}

Path parameters

taskID
required
string

TaskID

Response

200Tasksuccessful operation
link
read-only
string

Link to the document

status
read-only
TaskStatusEnum

Status of the task

ValuesERRORIN_PROGRESSSUCCESS
taskID
read-only
string

ID of the task

Example uses taskID = string

$ curl https://api.eu.ovhcloud.com/1.0/me/carbonCalculator/task/{taskID} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "link": "string", "status": "ERROR", "taskID": "string"}