API Operations

Documentation for entities

index

Overview

Allows to retrieve the list of entities accessible by the user.

As all others, this method requires authentication. To understand how to retrieve the authentication token, refer to the Login documentation page.

Request

endpoint
/api/v1/entities.[format]
http method
GET

format must be either json or xml

Required Parameters

None

Optional Parameters

None

Response

Response is a list of all the entities visible by the user. Each entry has the following attributes:

id
unique identifier of this entity
name
name of the entity

This is a sample response in JSON format:

{
  "entities": [
    {
      "id": 14,
      "name": "eNBilab srl"
    },
    {
      "id": 13,
      "name": "Producer"
    }
  ]
}
        

Examples

In each sample below, you have to substitute values between angular brackets (< and >) with the correct input data.

cUrl

curl -H "Authorization: Token token=<auth_token>" https://www.myo.io/api/v1/entities.json

Ruby (with rest_client)

require 'rest_client'
RestClient::Request.new(:method => "get", :url => 'https://www.myo.io/api/v1/entities.json', :headers => { :accept => :json, :content_type => :json, :'Authorization' => "Token token=<auth_token>"}).execute