Orders

All requests require a valid IDToken in the authentication header

Headers:

Authentication: Bearer {IDToken}

GET

/orders/

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)
stg: stage of the order [int - default empty string] (between 0 and 5)
own: if only users own orders or not [string - default false]
frst: what forest to filter by [string of forest uuid - default empty string]

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

hectars: estimated size of the order [float - can be 0]
order_type: order type as a binary string from left to right [string] (example 1110 is 7)
forest: name of the forest the order belongs to [string]

Optional Data

analysis_name: name of the analysis [string - default empty string]

Errors

Error Code 401

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

Error Code 400

This error code signifies a myriad of errors, some examples are 

  • bad input in regards to for example the name of forest or analysis
  • No forest existing with that name

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 500

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

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