Hexagon Geospatial
MENU

API

M.App Portfolio provides a modern, cloud-based platform for creating and delivering diverse geospatial web applications.
Through the M.App Studio, our partners can design, build, and deploy their own Hexagon Smart M.Apps.
Showing results for 
Search instead for 
Do you mean 

Foundation - Items API

by Technical Evangelist on ‎11-10-2016 07:18 AM (438 Views)

Foundation - Items API

 

Request all catalog items

Returns the information about the original request and an array of catalog items matching the request.

 

Request Endpoint:
GET /api/v1/items.json
Request Parameters:
Title Required Type Values Description
profile true String breif | full | summary Profile determines the ammount of detail that is returned with each catalog item.
keywords false String Any valid string Space separated set of keywords. This allows filtering of catalog items by specific keywords.
orderby false String asc | desc Return the catalog items ordered according to the given catalog attribute name. The attribute must be a valid attribute for the type of catalog item being queried. Use asc for ascending and desc for descending.
start true Integer Any valid integer Filter the results starting at this index and the total number of items
maxresults false Integer Any valid integer Maximum amount of results to return
classes false String Any valid entity class Comma delimited set of entity class names.
intersect false String Valid spatial extents Spatially filtering using a spatial intersection with a WKT-encoded geometry. Only valid for catalog item classes with a footprint.
catalog false String Ang valid organization id  Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Successful Response:
HTTP Status Code Reason Payload
200 Successfully retrieved all catalog items
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "context": {
    "totalAvailableResults": 0,
    "queryParameters": {},
    "maxResults": 0,
    "startIdx": 0,
    "queryTimeMillis": 0,
    "rootPath": "string",
    "_class": "string"
  },
  "results": [
    {
      "name": "string",
      "defaultAttachmentName": "string",
      "id": "string",
      "_class": "string",
      "title": "string",
      "parentId": "string"
    },
    ...
  ]
}

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
500 Unexpected Error

 

Request a catalog item

Returns a specific catalog item matching the given catalog item id.

 

Request Endpoint:
GET /api/v1/items/{ID}.json
Request Parameters:
Title Required Type Values Description
id true String Any valid catalog item id Id of the catalog item
profile true String
  • brief
  • summary
  • full
Profile determines the ammount of detail that is returned with each catalog item.
catalog false String Any valid organization id Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Successful Response:
HTTP Status Code Reason Payload
200 Successfully retrieved catalog item
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "context": {
    "totalAvailableResults": 0,
    "queryParameters": {},
    "maxResults": 0,
    "startIdx": 0,
    "queryTimeMillis": 0,
    "rootPath": "string",
    "_class": "string"
  },
  "results": [
    {
      "name": "string",
      "defaultAttachmentName": "string",
      "id": "string",
      "_class": "string",
      "title": "string",
      "parentId": "string"
    }
  ]
}

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results in the catalog.
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected error
{
  "error_description": "string",
  "error": "string"
}

 

Create a new property or edit an existing property for a catalog item

Either creates a new property, or updates an existing property, of a catalog item.

 

Request Endpoint:
POST /api/v1/items/{ID}/{propertyName}
 
Request Parameters:
Title Required Type Values Description
id true String Any valid catalog item id Id of the catalog item
propertyName true String Any valid string Name of the new property being created
type true* - type is only required if being used with value. String Any of the valid type code options

Type code for catalog item property. Type code defined as follows:

  • '1' = string
  • '2' = 32 bit integer
  • '3' = double
  • '4' = 64-bit integer
  • '5' = float
  • '6' = date (ISO-8601 format)

 

value true* - value is only required if being used with type String Any valid string Value for the catalog item property. Must be url encoded.
rename false* - rename is required if {type} and {value} are not present. String Any valid string Rename query string parameter for catalog item properties.
catalog false String Any valid organization id Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Successful Response:
HTTP Status Code Reason Payload
204 Successfully created property There is no response for a successful response

 

Sample request for creating a new property or editing a property:
{ 
    "type": "1", 
    "value": "This is the value of a string type property" 
}

 

 

Sample for renaming a property:
{ 
    "rename": "newPropertyName" 
}

 

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results in the catalog.
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected Error
{
  "error_description": "string",
  "error": "string"
}

 

Request a catalog item property

Retrieves the value for a specific catalog item property

 

Request Endpoint:
GET /api/v1/items/{ID}/{propertyName}.json
 
Request Parameters:
Title Required Type Values Description
Id true String Any valid catalog item id Id of the catalog item
propertyName true String Any valid string Name of the property being requested.
catalog false String Any valid organization id Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Sample Request:
{
    id: "e18b0308-47c3-42ef-a9a9-fabf56ceda19_2c918083566d176f015671de513f7426",
    propertyName: "sampleProperty"
}

 

 

Successful Response:
HTTP Status Code Reason Payload
200 Successfully retrieved catalog item property
propertyValue

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results in the catalog
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected error
{
  "error_description": "string",
  "error": "string"
}

 

Update attributes on a catalog item

Modifies a specific attributes on a catalog item

 

Request Endpoint:
PATCH /api/v1/items/{ID}.json
 
Request Parameters:
Title Required Type Values Description
Id true String Any valid catalog item id Id of the catalog item.
catalogAttributePatchPay true String A list of attributes and their corresponding values This property is responsible for containing the list of attributes and the new values for those attributes. See example below. 
catalog false String Any valid organization id Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Sample Request:
{ 
    "<sampleAttr1>": "<sampleValue1>",
    "<sampleAttr2>": "<sampleValue2>",
    "<sampleAttr3>": "<sampleValue3>"
    ...
}

 

Successful Response:
HTTP Status Code Reason Payload
201 Attributes successfully modified There is no payload for a successful response

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results in the catalog
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected error
{
  "error_description": "string",
  "error": "string"
}

 

 

Update multiple attributes on multiple catalog items

Modifies mulltiple attributes for collection of catalog items.

 

Request Endpoint:
POST /api/v1/items/bulk.json
 
Request Parameters:
Title Required Type Values Description
catalogBulkOperationsPayload true String
  • updates

Payload for specifying bulk operations on the catalog.

updates true Array[Object]
  • ids
  • patch
  • rightsput
  • rightsdelete
  • propertiesput
  • propertiesdelete

Property that contains all of the avaiable bulk operations and the ids to perform the operations on.

ids true Array[String] Any valid catalog item id

Array of ids to perform operations on.

patch * Object Any valid property we want to modify on the specified ids

Property containing key-value pairs for all attributes we want to modify and the values to patch the attributes with.

rightsput * Array[Object] Any of the valid rights we want to assign to the specified ids

Array containing principal names and the corresponding rights we want to assign.

rightsdelete * Array[String] Any of the valid rights we want to remove from the specified ids

Array containing what rights we want to remove from the specified ids.

propertiesput * Array[Object] Any new property we want to create, or any current property we want to modify Array of properties we want to create or modify on the specified ids.
propertiesdelete * Array[String] Any valid property on the specified ids Array of properties we want to remove from specified ids.

Note: At least one of the properties with (*) in the required column must be included in the request.   

 
Bulk Request format:
{ "updates" :
  [
    {
      "ids":["<id1>","<id2>",...],
      "patch":{
         "<attr1>":"<val1>",
         "<attr2>":"<val2>",
          ...
      },
      "rightsput": [
        {"principal":"<principal-name1>","<right1-1>":true/false,"<right1-2>":true/false,...},
        {"principal":"<principal-name2>","<right2-1>":true/false,"<right2-2>":true/false,...},
        ...
      ],
      "rightsdelete": [
        "<principal-name1>",
        "<principal-name2>",
        ...
      ],
      "propertiesput": [
        {
          "name":"<property-name1>",
          "type":"<type-code1>",
          "value":"<string-representation1>"
        },
        {
          "name":"<property-name2>",
          "type":"<type-code2>",
          "value":"<string-representation2>"
        },
        ...
      ],
      "propertiesdelete": [
        "<property-name1>",
        "<property-name2>",
        ...
      ]
    },                              
    ...
  ]
}   

 

Successful Response:
HTTP Status Code Reason Payload
204 All updates were successfully applied. There is no payload for a successful response

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
500 Unexpected error

 

Request an attachment of a catalog item

Retrieves an attachment for a specific catalog item.

 

Request Endpoint:
GET /api/v1/items/{ID}/attachments/{attachmentName}
 
Request Parameters:
Title Required Type Values Description
Id true String Any valid catalog item id Id of the catalog item.
attachmentName true String Any valid string Name of the catalog item attachment.
catalog false String Any valid organization id

Directs requests to application specific partner catalog. Use the organization id of the partner that created the application.

 

Successful Response:
HTTP Status Code Reason Response
200 Successfully retrieved catalog item attachment There is no payload for a successful response 

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results in the catalog
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected error
{
  "error_description": "string",
  "error": "string"
}

 

 

Delete a property from a catalog item

Removes a specific property from a catalog item

 

Request Endpoint:
DELETE /api/v1/items/{ID}/{propertyName}

 

Request Parameters:
Title Required Type Values Description
Id true QueryString Parameter Any valid catalog item id Id of the catalog item.
propertyName true QueryString Parameter Any valid non-readonly catalog item property  Name of the catalog item property.

 

Successful Response:
HTTP Status Code Reason Payload
204 Successfully deleted the catalog item property There is no response for this request

 

Error Response:
HTTP Status Code Reason Payload
401 Unauthorized
{
  "error_description": "string",
  "error": "string"
}
404 No results found in the catalog
{
  "_encodingVersion": "string",
  "_encodingTime": 0,
  "errorMessage": "string"
}
500 Unexpected error
{
  "error_description": "string",
  "error": "string"
}

 

Contributors