Authentication
How to access secured APIs
The GoodData.CN API is a core part of GoodData.CN. With the GoodData.CN API, you can integrate all of the features of GoodData.CN into your own application. Alternatively, you can browse through the data and actions of GoodData.CN by using any application capable of sending HTTP requests.
The GoodData.CN public API is divided into three major categories. Each category has its own URI space and unique set of properties. Dividing the API into multiple categories helps ensure that the APIs are identifiable for their particular use case.
We’re aware that not all of the APIs in these categories meet the requirements to be RESTful1. In fact, only the entity API interface fully conforms to the constraints of the REST architectural style. There was no strong reason to adhere to the REST architecture to make the declarative API interface change or read the state of several resources in one operation. Nor was there a strong reason to fully adhere to RESTful architecture to make sure the RPC API interface doesn’t change persistent resources. We chose this approach to help make the API intuitive and consistent according to its category and use case.
The entity API interface is composed of interconnected resources that represent the application state. The API design fully conforms to RESTful principles to take advantage of hypermedia, HTTP caching, and easy resource discovery. There is also advanced support for filtering and querying by entity fields for collection resources, as well as support for uniform paging and support for compound documents2.
The format of the entity API interface is based on the JSON:API specification. Our implementation does not include special features such as sparse fieldsets. However, we do use vendor specific implementations of other features (default relationships payload, filtering, and etc.). Because we have our own implementation of several features, the vendor specific media type is used for the entity API interface.
There are several differences between JSON:API and our implementation. The payload follows the top level structure of JSON:API but:
include
to also extend the payload with the definition of related objects.include
(ex. ?include=datasets,labels
).include
arguments affect the relationship part of the payload.When you use include
, it is possible to specify the types of entities to include in the definition of a queried entity, but not vice versa.
To find entities of a particular type that include or use a known specific entity, you must combine filter
and include
.
For example, you can query the entity type you are looking for and use the identifier of the specific entity to filter result through the relationship:
.../api/entities/workspaces/<workspace-id>/<entity-type>?include=<specific-type>&filter=<relations-name>.id==<specific-entity-id>
Example: Return all dashboards having relationship with visualization objects with the id SalesReport
.../api/entities/workspaces/demo/analyticalDashboards?include=visualizationObjects&filter=visualizationObjects.id==SalesReport"
From the client perspective, the entity API interface is a state machine that can be manipulated and managed by accessing resources one-by-one when all of them are linked with hypertext. This is the main difference between the entity API interface and the declarative API interface which works with the model specified in the all-in-one document only.
Most of the entities are exposing a CRUD interface, and some of them are Read only (where updates can be done by declarative API interface.
Every object is identified by two items [type, id] similarly to JSON:API:
dataSource
for Data Source, workspace
for Workspace and so on)a-Z0-9._-
.workspace
if referenced from another (inherited) workspace - workspace:id
grain
/reference
, it can contain id like parent:id
To see more examples, see Workspace Object Identification.
The path for all resources conforming to the entity API interface is located under .../api/entities/*
.
The media type is application/vnd.gooddata.api+json
. This is a vendor specific extension of JSON media inspired by JSON::API.
The declarative interface works with the model specified in the all-in-one document only. This is the main difference between the the declarative API interface and the entity API interface which allows accessing and managing objects one by one.
The payload does not contain any specific meta-fields as entities in one declarative resource do not reference any other declarative resources.
Each object in the declarative payload contains a unique id. The unique instances of a specific object are named with a combination of its type from the context of the JSON wrapper node and an id.
Example of Workspace Data Filter with id ‘unique_id_122’:
{
"workspaceDataFilters": [
{
"id": "unique_id_122",
...
},
...
]
}
For referencing other objects, the identifier with id & type must be used:
{
"identifier" :
{
"id" : STRING,
"type" : "workspace"|"analyticalDashboard"|...,
}
}
.../api/layout/*
.application/json
.This category represents actions, for example - RPC3 over JSON API. In the scope of the GoodData.CN API, public Actions are operations which typically do not change the internal state of resources. The most common use-case is to start a process (for example, the POST HTTP method) where the result can be later retrieved (for example, the GET HTTP method depending on if a specific resource is used synchronously or asynchronously).
.../api/actions/*
and it is further divided into the following components:.../api/actions/workspaces/{wsId}/execution/afm/execute
or computing valid objects - .../api/actions/workspaces/{wsId}/execution/afm/computeValidObjects
.../api/actions/dataSources/{dataSourceId}/scan
or testing - .../api/actions/dataSources/{dataSourceId}/test
Data Sources.application/json
.REST is software architectural style on top of HTTP. RESTful APIs are APIs that conform to this architectural style. ↩︎
Squashing related data into the main requested resources - JSON:API definition. ↩︎
RPC - Remote Procedure Call, commands/procedures running on target server executed over the network. ↩︎
How to access secured APIs
Common rules across the API space
Learn how errors are communicated
Learn how to communicate with the API
How to filter results on entities API
Browse through all exposed resources