(POST) Tonnes API

Add tonnes data

Version 1: (V1)

URL

https://api.pdsglobal.com/api/integration/tonnes/V1

Description

 

This URL will allow a customer to add their tonnes data into the PDS software in real-time.

An “areaId” is used to define the functional location (or Area) in the PDS software for which the tonnes information will be assigned. For a detailed list of these Id’s please contact PDS support.

The “tonnesDate” field defines the date and time in which the Tonnes data was recorded. The format is  yyyy-MM-dd HH:mm:ss.SSS and accepts the user’s current local datetime.

timeZoneOffset” refers to the user’s timezone offset from UTC and is used to convert tonnesDate into a UTC datetime. (e.g. “+1000” is UTC+10:00, “-0830” is UTC-08:30)

 

Type

POST

URL Parameters

(1)

(key)      api_key

(value)   Provided separately to this document

(key)     tonnesType

(value)  Cumulative or Incremental

Request Data

(single record)

[

{

“areaId”: ”1”,
"tonnesDate": "2017-01-01 00:00:00.000",
“timeZoneOffset”: “+1000”,
"tonnes": "40000"

}

]

Request Data

(multiple records)

[

{

“areaId”: ”1”,
"tonnesDate": "2017-01-01 00:00:00.000",
“timeZoneOffset”: “+1000”,
"tonnes": "40000"

},

{

“areaId”: ”1”,
"tonnesDate": "2017-01-01 01:00:00.000",
“timeZoneOffset”: “+1000”,
"tonnes": "50000"

}

]

Response Data

HTTP Response OK (200)
HTTP Response Bad Request (400)
- Missing api_key parameter
- Missing tonnesType parameter
- Invalid JSON syntax
- Incorrect areaId value
- Incorrect tonnesType value
HTTP Response Forbidden (403)
- Invalid/Incorrect API Key
- Non “API User” role
HTTP Response Internal Server Error (500)
- The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_Tonnes_Areas\". The conflict occurred in database \"CCMS_TESTING \", table \"dbo.Areas\", column 'AreaID'.;
- Invalid areaId, tonnesDate, timeZoneOffset, and tonnesCumulative value

 


Version 2: (V2)
 

URL

https://api.pdsglobal.com/api/integration/tonnes/V2

Description

This URL will allow a customer to add their tonnes data into the PDS software in real-time.

An “areaId” is used to define the functional location (or Area) in the PDS software for which the tonnes information will be assigned. For a detailed list of these Id’s please contact PDS support.

The “tonnesDate” field defines the date and time in which the Tonnes data was recorded in the user’s local datetime. The format is:

yyyy-MM-dd HH:mm:ss.SSS

Type

POST

URL Parameters

(2)

(key)      api_key

(value)   Provided separately to this document

(key)     tonnesType

(value)  Cumulative or Incremental

Headers (1)

(key)     Content-Type

(value)  application/json

Request Data

(single record)

[

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 00:00:00.000",

"tonnes": "40000"

}

]

Request Data

(multiple records)

[

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 00:00:00.000",

"tonnes": "40000"

},

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 01:00:00.000",

"tonnes": "50000"

}

]

Response Data

HTTP Response OK (200)

HTTP Response Bad Request (400)

-          Missing api_key parameter

-          Missing tonnesType parameter

-          Incorrect tonnesType value

-          Incorrect areaId value

-          Invalid areaId, and tonnes value

-          Invalid JSON syntax

HTTP Response Forbidden (403)

-          Invalid/Incorrect API Key

-          Non “API User” role

HTTP Response Unsupported Media Type (415)

-          Missing Content-Type header

HTTP Response Internal Server Error (500)

-          Invalid tonnesDate value

 

Version 3: (V3)  Internal Use Only

 

Version 4: (V4) 

URL

https://api.pdsglobal.com/api/integration/tonnes/V4

Description

This URL will allow a customer to add their tonnes data into the PDS software in real-time.

An “areaId” is used to define the functional location (or Area) in the PDS software for which the tonnes information will be assigned. For a detailed list of these Id’s please contact PDS support.

The “tonnesDate” field defines the date and time in which the Tonnes data was recorded in the user’s local datetime. The format is:

yyyy-MM-dd HH:mm:ss.SSS

Type

POST

URL Parameters

(2)

(key)      api_key

(value)   Provided separately to this document

(key)     tonnesType

(value)  Cumulative or Incremental

Headers (1)

(key)     Content-Type

(value)  application/json

Request Data

(single record)

[

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 00:00:00.000",

"timeZoneOffset": "+1100",

"tonnes": "40000"

}

]

Request Data

(multiple records)

[

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 00:00:00.000",

"timeZoneOffset": "+1100",

"tonnes": "40000"

},

 

{

“areaId”: ”1”,

"tonnesDate": "2017-01-01 01:00:00.000",

"timeZoneOffset": "+1100",

"tonnes": "50000"

}

]

Response Data

HTTP Response OK (200)

HTTP Response Bad Request (400)

-          Missing api_key parameter

-          Missing tonnesType parameter

-          Incorrect tonnesType value

-          Incorrect areaId value

-          Invalid areaId, and tonnes value

-          Invalid JSON syntax

HTTP Response Forbidden (403)

-          Invalid/Incorrect API Key

-          Non “API User” role

HTTP Response Unsupported Media Type (415)

-          Missing Content-Type header

HTTP Response Internal Server Error (500)

-          Invalid tonnesDate value

prev next
Was this article helpful?
0 out of 0 found this helpful

Articles in this section

prev next

Related sections