API Management Service

The API management microservice provides services to create, manage and validate API tokens to register mobile and desktop apps, and to issue and refresh API tokens of registered mobile and desktop app devices.

Get a new bearer token

post

This API is used to obtain a bearer token

  • Required fields cannot be left null or empty
Authorizations
Path parameters
consumerstringRequired

Append any text to the request URL

Example: mobile_device
Body

A unique key which helps in identifying the token

Responses
200
OK
application/json
post
POST /api//api-manager/v1/consumer/{consumer}/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "ekstep.api.am.adminutil.consumer.create",
  "ver": "1.0",
  "ts": 1606903294596,
  "params": {
    "status": "successful",
    "err": null,
    "errmsg": null,
    "msgid": "",
    "resmsgid": "0a0d4cc2-58c0-42e0-bd98-66004517cf00"
  },
  "result": {
    "key": "SunbirdUser",
    "secret": "tzppMyvMWJTA8Y5FUxoyvjCLswa47u7Pi",
    "token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTdW5iaXJkVXNlciIsImlhdCI6MTUxNjIzOTAyMn0.HUsyhT5jvusvN1f-Q6b9NOxAPy-HsEeC_icbpbDNjQY"
  }
}

Get a new bearer token

post

This API is used to obtain a bearer token

  • Required fields cannot be left null or empty
Authorizations
Path parameters
consumerstringRequired

Append any text to the request URL

Example: mobile_device
Body

A unique key which helps in identifying the token

Responses
200
OK
application/json
post
POST /api//api-manager/v2/consumer/{consumer}/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "ekstep.api.am.adminutil.consumer.create",
  "ver": "1.0",
  "ts": 1606915336200,
  "params": {
    "status": "successful",
    "err": null,
    "errmsg": null,
    "msgid": "",
    "resmsgid": "3c6fdb62-1dcd-49b1-a404-bcd7e2e5a0d1"
  },
  "result": {
    "key": "SunbirdUser",
    "secret": "",
    "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1vYmlsZSJ9.eyJpc3MiOiJTdW5iaXJkVXNlciIsImlhdCI6MTYwNjkxNTMzNn0.FEZfy-Q-ljIxQRE-JYRu-9qlezDtgPcPGcbFU8mnWQGsHowxNGcYvKvkwVUnTE7BmpPeM4vbfv4d0cRL261daqZWj9nE4zXRglWFDn96Ll2rvi3Kb-AChKlANDhzh4MTqPigIOABX7ZPLMKlxiQx74Ezl5NYhyrbfgRK3_nt4kipyNahvhU1TIaD0DnVrnUPdosk1jtl3wP9tL7E3oKBHfN3BUiGKzYtfWcYrNtXkx5VXsn4EhIOE79GIn72cYqGIUK4cRftfntqKo4FMUk4sX-rbEOZNLQRk3WIl8XwhP3iZv2saZZSEq_EMrLW4aN0vPH9RgoL4QZqi96O7tBypg"
  }
}

Get a new access token

post

This API is used to obtain a new access token

  • Required fields cannot be left null or empty
Authorizations
Body

Refresh Token

refresh_tokenstringRequired
Responses
200
OK
application/json
post
POST /api//auth/v1/refresh/token HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 24

"refresh_token='text'"
{
  "id": "api.refresh.token",
  "ver": "1.0",
  "ts": 1606816047013,
  "params": {
    "resmsgid": "abf4051d-1449-4ea6-8c56-af44faa4c86e",
    "status": "successful",
    "err": null,
    "errmsg": null
  },
  "result": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2VzczAifQ.eyJhdWQiOiJhbmRyb2lkIiwic3ViIjoiZjo1MGY5NjdkNC1iOWRiLTQ1MjgtOTUwYy1iOWYwMzMyZTYzYmE6YTFlNjRiNDEtMTZjZC00N2Y3LTk4OWQtYTYwNWU3NDBkMDQwIiwiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNjA2OTI5MjA0LCJpYXQiOjE2MDY4ODY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1saW5rcyIsInZpZXctcHJvZmlsZSJdfX19.J6DNcnUUrqyCXlBo0qtgm5csDvRTDPElZUETCBlNVFSh6SsT04frzvVRotJ2bfRFA11AqpWblyFVkopIY6hk23xzP3zxh6tw6fn6GLClvFamYIKTZi9FBMT1qhVcKtIcHDdgs69xRwZu72ip6Ks4kccOC_HTTDQ_BUpY95ZrS-P90LGb9SD4JV5XU9e7YIUPxs-bnJ-G564wRfmc7xdg8J6SZZCsD5iXyTXFT7_O3kQci9EIhwVEuS6AIOz_gWtsVW_ee1wEX8dYK2OGqXZWa00dCue6KdLshHY4vB_Gewed2V7_tAS6vAkX4vCzthC6lBKlPpzBW0KF0B-n8urfpA"
  }
}

Get API token

post

This API is used to get the token.

  • /consumer/desktop_device/credential/register/ endpoint helps to get the token.
  • Required fields cannot be left null or empty
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource.Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

Body
Responses
200
SUCCESS. The operation was successful!
application/json
Responseall of

Get Token Response

and
post
POST /api/api-manager/v2/consumer/desktop_device/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Content-Type: */*
Authorization: text
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "text",
  "ver": "text",
  "ets": 1,
  "params": {
    "resmsgid": "text",
    "msgid": "text",
    "err": "text",
    "status": "text",
    "errmsg": "text"
  },
  "result": {
    "key": "text",
    "secret": "text",
    "token": "text"
  }
}

Last updated

Was this helpful?