Documentation Documentation

Portal Developers

List Developers

Property Description
Resource URL /api/portal/developers
Method GET
Type None
Body None
Param None

Sample Request

GET /api/portal/developers HTTP/1.1
Host: localhost
authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "Data": [
    {
      "_id": "554c733a30c55e4b16000002",
      "api_keys": {
        "b605a6f03cc14f8b74665452c263bf19": "90568dfa"
      },
      "date_created": "2015-05-08T04:26:34.287-04:00",
      "email": "[email protected]",
      "fields": {
        "Name": "Mondgo Brtian",
        "custom1": "Test",
        "custom2": "Test"
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002",
      "password": "$2a$10$ztUTWXmyrK6B5fdKoisohuhZlQ3P1weQZ2CBwR6HYw1rWyiBJ7ZSW"
    },
    {
      "_id": "5555ec63a8b6b60001000001",
      "api_keys": {},
      "date_created": "2015-05-15T08:53:54.873-04:00",
      "email": "[email protected]",
      "fields": {
        "Name": "Tes",
        "custom1": "",
        "custom2": ""
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002",
      "password": "$2a$10$8mGEdcow4dwVDAt4If.Sieps57oGZDwEVvwTNYq1J8FLba4fHw9Nu"
    },
    ...
  ],
  "Pages": 1
}

List Developers by API

Property Description
Resource URL /api/portal/developers/api/{apiID}
Method GET
Type None
Body None
Param None

Sample Request

GET /api/portal/developers/api/ HTTP/1.1
Host: localhost
authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "Data": [
    {
      "_id": "554c733a30c55e4b16000002",
      "api_keys": {
        "b605a6f03cc14f8b74665452c263bf19": "9184c7d0"
      },
      "date_created": "2015-05-08T04:26:34.287-04:00",
      "email": "[email protected]",
      "fields": {
        "Name": "Mondgo Britain",
        "custom1": "Test",
        "custom2": "Test"
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002",
      "password": "$2a$10$ztUTWXmyrK6B5fdKoisohuhZlQ3P1weQZ2CBwR6HYw1rWyiBJ7ZSW"
    },
    {
      "_id": "5555ef2e24cb3e0001000001",
      "api_keys": {
        "b605a6f03cc14f8b74665452c263bf19": "90e670bc"
      },
      "date_created": "2015-05-15T09:05:50.675-04:00",
      "email": "[email protected]",
      "fields": {
        "Name": "Martin",
        "custom1": "test",
        "custom2": "test"
      },
      "inactive": false,
      "org_id": "53ac07777cbb8c2d53000002",
      "password": "$2a$10$MH.nxHBneFuuGTrVgfxeRecgmYNHVHm8Bo7DWVqY5o2anlPgJ2zWa"
    }
  ],
  "Pages": 0
}

Add a Developer Record

Property Description
Resource URL /api/portal/developers
Method POST
Type None
Body Developer Object
Param None

Sample Request

POST /api/portal/developers HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8
    
{
  "email": "[email protected]",
  "password": "$2a$10$hlG1ujAHWUpnM37k.l1RhO6RrxkCpXki2yrGhufnDs1IBiUo4Kzqy",
  "date_created": "2015-05-15T08:56:13.257-04:00",
  "inactive": false,
  "org_id": "53ac07777cbb8c2d53000002",
  "api_keys": {
    "b605a6f03cc14f8b74665452c263bf19":"90568dfa"
  },
  "fields": {
    "Name": "",
    "custom1": "",
    "custom2": ""
  }
}

Sample Response

{
  "Status":"OK",
  "Message":"<developer-id>",
  "Meta":""
}

Update a Developer Record

Property Description
Resource URL /api/portal/developers/{id}
Method PUT
Type None
Body Developer Object
Param None

Sample Request

PUT /api/portal/developers/5555eceda8b6b60001000004 HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8
    
{
  "id": "5555eceda8b6b60001000004",
  "email": "[email protected]",
  "password": "$2a$10$hlG1ujAHWUpnM37k.l1RhO6RrxkCpXki2yrGhufnDs1IBiUo4Kzqy",
  "date_created": "2015-05-15T08:56:13.257-04:00",
  "inactive": false,
  "org_id": "53ac07777cbb8c2d53000002",
  "api_keys": {
    "b605a6f03cc14f8b74665452c263bf19":"90568dfa"
  },
  "fields": {
    "Name": "",
    "custom1": "",
    "custom2": ""
  }
}

Sample Response

{
  "Status":"OK",
  "Message":"Data updated",
  "Meta":""
}

Delete a Developer

Property Description
Resource URL /api/portal/developers/{id}
Method DELETE
Type None
Body None
Param None

Sample Request

DELETE /api/portal/developers/554c733a30c55e4b16000002 HTTP/1.1
Host: localhost
Authorization:7a7b140f-2480-4d5a-4e78-24049e3ba7f8

Sample Response

{
  "Status":"OK",
  "Message":"Data deleted",
  "Meta":""
}

Verify Developer Credentials

NOTE: This functionality is available from v2.3.8 onwards

Property Description
Resource URL /api/portal/developers/verify_credentials
Method POST
Type None
Body None
Param None
curl https://admin.cloud.tyk.io/api/portal/developers/verify_credentials \
  -X POST \
  -H "authorization: $TYK_API_KEY" \
  -d \
  '{
     "username": "<developer-email>",
     "password": "<developer-password>"
   }'

If the user credentials are verified, the HTTP response code will be 200 (OK), otherwise credentials do match and a 401 error (Unauthorised) will be returned.

Reset Developer Password

NOTE: This functionality is available from v2.3.8 onwards

Property Description
Resource URL /api//portal/developers/password/:Id
Method POST
Type None
Body None
Param None

Sample Request

curl https://admin.cloud.tyk.io/api/portal/developers/password/:Id \
-X POST \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "password": ""
}'

Sample Response - Password Changed

{
  "Message":"Password changed"
}

Sample Response - Incorrect Developer ID

{
  "Status": "Error", "Message":"Developer password validation failed."
}

Analytics

You can get aggregate statistics for 1 key or all developer keys (need to specify a list of all keys). Also, you can group by day (hour or month), and by API (policy id).

API Endpoint: /api/activity/keys/aggregate/#{keys}/#{from}/#{to}?p=-1&res=day

  • keys should be specified separated by ',' delimiter.
  • from and to values must be in // format.
  • resolution specified res attribute: 'day', 'hour' or 'month'
  • api_id - policy id associated with developer portal API. If ommited return stats for all APIs.

Request

curl "https://admin.cloud.tyk.io/api/activity/keys/aggregate/add2b342,5f1d9603,/5/8/2017/13/8/2017?api_id=8e4d983609c044984ecbb286b8d25cd9&api_version=Non+Versioned&p=-1&res=day" \
-X GET \
-H "authorization: $TYK_API_KEY"

Response

{ "data":[
  {
    "id":{"day":9,"month":8,"year":2017,"hour":0,"code":200},
    "hits":13,
    "success":10,
    "error":3,
    "last_hit":"2017-08-09T12:31:02Z"
  },
  ...
],"pages":0}

In example above add2b342,5f1d9603, is 2 users keys. Note that this example shows hashed key values as described here. Key hashing is turned on for the Cloud, but for Multi-Cloud and On-Premises installations you can also turn it off. Hashed keys mean that the API administrator does not have access to real user keys, but they can still use the hashed values for showing analytics.

Add Subscription To Developer

Property Description
Resource URL /portal/developers/:Id/subscriptions
Method POST
Type None
Body Subscription Object
Param None

Sample Request

curl https://admin.cloud.tyk.io/api//portal/developers/:Id/subscriptions \
-X POST \
-H "authorization: $TYK_API_KEY" \
-d \
'{
  "policy_id": "<pol-id>",
  "fields": {
      "foo": "bar"
  },
  "oauth_info": {
    "redirect_uri": "..."
  }
}'

Change Developer Key Policy

Property Description
Resource URL /portal/developers/:developerId/:keyId/:policyId
Method GET
Type None
Body None
Param None

Revoke Developer Key

Property Description
Resource URL /portal/developers/key/:apiID/:keyID/:Id
Method DELETE
Type None
Body None
Param None

Reset Developer Key Quota

Property Description
Resource URL /portal/developers/key/:apiID/:keyID/:Id/reset_quota
Method POST
Type None
Body None
Param None

Delete OAuth app

Property Description
Resource URL /portal/developers/oauth/:apiId/:appId
Method DELETE
Type None
Body None
Param None