API Operations

Documentation for entities

show

Overview

Allows to retrieve the details of a single entity 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/[id].[format]
http method
GET

id is the ID obtained with the index api call.

format must be either json or xml

Required Parameters

None

Optional Parameters

None

Response

Response is a list of the attributes of the entity, containing the following fields.

id
unique identifier of this entity
name
name of the entity
permission_type
type of the entity, either 'producer' or 'consumer'
company_name
Business name of the entity
country
Country of the entity
address
Address of the entity
vat_code
VAT code of the entity
phone_number
Phone number of the entity
web_address
WEB addres of the entity
email_address
Email address of the entity
monthly_upload_limit
Maximum number of documents uploadable per month (applies only if permission_type is 'producer', 0 means no limit).
max_document_size
Maximum size of the uploadable document (applies only if permission_type is 'producer', 0 means no limit).
logo_url
PATH to retrieve the entities logo.

This is a sample response in JSON format:

{"entity":
  {
    "id":14,
    "name":"eNBilab srl",
    "permission_type":"consumer",
    "company_name":"eNBilab srl",
    "country":"",
    "address":"",
    "vat_code":"",
    "phone_number":"",
    "web_address":"",
    "email_address":"",
    "monthly_upload_limit":0,
    "max_document_size":0,
    "logo_url":"http://localhost:3000/system/entities/logos/000/000/014/original/logo20130516-32040-140eeu5.jpg?1368695759"
  }
}
        

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/14.json

Ruby (with rest_client)

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