Home Page > Integration > REST API > Projects

Projects

Projects - /REST/1/Projects/:id

This endpoint is used for manipulating Project resources within the system. Objects are always returned in a JSON format within an array. Empty results return an empty array.

 

Object

The Project resource is represented with the following JSON object:

 [
 ​    {
 ​        "alive": "<bool>",
 ​        "code": "<string>",
 ​        "code_alias_1": "<string>",
 ​        "code_alias_2": "<string>",
 ​        "id": "<int>",
         "location": {
            "address": "<string>",
            "city": "<string>",
            "country": "<string>",
            "google_id": "<string>",
            "latitude": "<int>",
            "longitude": "<int>",
            "name": "<string>",
            "postal_code": "<string>",
            "state": "<string>",
            "street": "<string>",
            "street_number": "<string>"
         },
         "hero_image_id": "<int>",
 ​        "name": "<string>",
 ​        "name_alias_1": "<string>",
 ​        "name_alias_2": "<string>",
         "updated": "<date>"
 ​    }
 ​]

Items emboldened and italicized  require additional query parameters. Please refer to GET for additional parameters.

Last Updated: June 27th, 2018

GET

As with other resources, this resource is subject to the global parameters mentioned in the REST Overview.

 

JSON Parameter Allowed Values Response
withHeroImage Boolean (0 or 1) "hero_image_id": "<int>"
withLocation Boolean ( 0 or 1) "location": {
            "address": "<string>",
            "city": "<string>",
            "country": "<string>",
            "google_id": "<string>",
            "latitude": "<int>",
            "longitude": "<int>",
            "name": "<string>",
            "postal_code": "<string>",
            "state": "<string>",
            "street": "<string>",
            "street_number": "<string>"
         }

 

PUT

The following JSON parameters are available when updating a resource:

 

JSON Parameter Allowed values  
alive bool  
code string  
code_alias_1 string  
code_alias_2 string  
name string  
name_alias_1 string  
name_alias_2 string  
updated date  

 

Possible Errors

Sending an invalid project code (based on system preferences):

curl -H "Authorization: Basic YWRtaW46YWRtaW4=" \
  http://my.openasset.example.org/REST/1/Projects/5 \
  -D -X PUT \
  -d '{"code": ""}'

Will result in the following response:

HTTP/1.1 400 Bad Request

{
   "error_message" : "Invalid project code",
   "http_status_code" : "400"
}

 

POST

The following JSON parameters are required when creating a resource:

 

JSON Parameters Allowed values
name string
code string

 

The remaining fields mentioned in the PUT method are also available in the POST method.

 

DELETE

The resource can be deleted using this verb and including the id in the endpoint URL. 

 

Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.