Using the API

API BaaS uses a pure REST (Representational State Transfer) API built as a collection of resources. Resource locations are described by paths that are related intrinsically to collections and entities in collections.

This section gives several examples of how to construct API requests. To focus on what's important, the examples use an abbreviated path that starts after the application UUID, or application name. For example, instead of giving a fully qualified path name as in:

Supported HTTP methods

When building a REST API, the challenge is to represent the data and the action upon the data as a path to a resource that can be created, retrieved, updated, or deleted. The HTTP methods POST, GET, PUT, and DELETE correspond to the actions that are applied to resources.

Authentication (OAuth)

Generally, you will generate a token for every user of your app by providing the user's username and password. The token can then be sent with all API requests to ensure each user is only able to access and modify the resources you have granted them rights to.

Note that by default access tokens are not needed to make requests to the default sandbox application in an organization.

Response format

All API methods return a response object that typically contains an array of entities:

{
"entities" : [
...
]
}

Not everything can be included inside the entity, and some of the data that gets associated with specific entities isn't part of their persistent representation. This is metadata, and it can be part of the response as well as associated with a specific entity. Metadata is just an arbitrary key/value JSON structure.

SDKs

To make the integration of API BaaS features into your application code quicker and easier, Apigee offers SDKs in a variety of languages. The SDKs contain language-specific methods that allow you to issue API requests from your application code in your preferred language. SDKs are available for the following languages: