Getting started
Introduction
The IBM ECDN (Enterprise Content Delivery Network) API lets you monitor and manage your ECDN locations, servers and other resources.
Try it out
API Browser is the easiest way to try ECDN’s GraphQL API.
You can log in via your ECDN credentials.
Generated documentation can be found by opening Docs
in the upper-right corner, which are also available on this site.
GraphQL
We suggest reading the official GraphQL documentation to get a basic understanding of its usage. This documentation focuses on ECDN specific usage.
All/specific resources
We will use servers
and locations
throughout this document, which covers all servers and/or all locations when used.
If you want to query them one-by-one use serverByID
and locationByID
instead. i.e:
{locations {idname}}
will return ID and name of all locations, where
{locationByID(id:"bG9jYXRpb246MzA1") {idname}}
will return ID and name of location with ID of "bG9jYXRpb246MzA1"
only (if it exists).
Example queries
Locations ID, name, external ranges and number of servers.
{locations {idnamenumberOfServersexternalRanges}}Servers ID, FQDN, CPU, memory, system disk size (in bytes), cache disk size (in bytes), IP address, location name, ECDN version with patch level and last check in date.
{servers {idfqdnlastCheckInlocation {name}update {Servers ID, FQDN, detailed health and status of video delivery.
{servers {idfqdnhealth {contentDelivery {aggregatedupstreamscaching
Basic workflow
Fetch tokens.
curl 'https://api.ecdn.video.ibm.com/v1/login' \-d '{"email":"...","password":"..."}'Returns:
{# JWT token, see https://jwt.io."accessToken": "YOUR_ACCESS_TOKEN",# This can only be used once."refreshToken": "YOUR_REFRESH_TOKEN",# Currently, refresh token expires in one day."refreshAgeSeconds": 86400}Use API with access token. Note that all if you had a query
{servers{id}}
at API Browser, you must send it as'{"query":"{servers{id}}"}'
if you use the API directly.curl -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \https://api.ecdn.video.ibm.com/v1/graphql \-d '{"query":"{servers{id}}"}'Refresh tokens. Currently your access token expires in 5 minutes. The actual expiration time can be extracted from JWT’s
exp
field. Therefore, you must use your refresh token to request a new access token before/if it expires.curl 'https://api.ecdn.video.ibm.com/v1/token/refresh' \-d '{"refreshToken":"YOUR_REFRESH_TOKEN"}'Returns:
{# JWT token, see https://jwt.io."accessToken": "YOUR_NEW_ACCESS_TOKEN",# This can only be used once."refreshToken": "YOUR_NEW_REFRESH_TOKEN",# Currently, refresh token expires in one day."refreshAgeSeconds": 86400}