Forests

All the following requests require a valid IDToken in the authentication header

Headers:

Authentication: Bearer {IDToken}

GET

/myforest/

Optional URL Parameters

Sort

method: the method to sort the orders buy, one of the following [string - default date_created]
 	- id
 	- owner
 	- date_created
 	- finished
 	- stage
 	- forest
 	- hectars
 	- type_of_order
acs: ascending '' or descending '-' [string - default empty string]
page: what page to show [int - default 1] (if this number is bigger than number of pages, page 1 will be returned)
opp: orders per page [int - default 10]
skey: string to search the orders buy, will search the names [string - default empty string]

Filter

scd: start of date of order creation filter [date time string - default 2021-01-01]
ecd: end of date of order creation filter [date time string - default current date & time]
mins: minimum size of order [float - default 0.0] (cannot be lower than 0.0 or higher max_size)
maxs: maximum size of order [float - default 10000.0] (cannot be higher than 10000 or lower than min_size)
con: what forest the forest is in NOT YET IMPLEMENTED [string - default Unknown]

Response

  • a status code of 200
  • a dictionary containing the following
    • the orders and their data serialized in dictionaries
    • the number of pages

POST

Sending a POST request with a valid IDToken to 

/orders/

Required Data

size: Size of the forest in hectars [float]
forestname: Unique name of the forest [string]
shapefile: Shapefile representing the forest [SHP]

Optional Data

thumbnail: Image of the forest, in the case of portal.arboair.com it comes with the shapefile overlaid [IMG]

Response

  • a status code of 200
  • a dictionary containing the following
    • the orders and their data serialized in dictionaries
    • the number of pages

Errors

Error Code 400

This error code signifies a myriad of errors, mostly to do with bad input data.

If this code is returned check for a specific reason in the response text else contact Arboair with the code & time of the API request

Error Code 401

If this error code is received the IDToken is no longer valid. Please see refresh for refreshing your tokens.

Error Code 402

The user has exceeded their number of allowed forests.

Error Code 409

Forest with that name already exists

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us