Back to top

Token Directory Service

This service stores Token Apps with all the required metadata to construct SOFA App Manifests for them. It provides index, curation, and search functionalities.

Apps

App Index

Fetch list of apps
GET/v1/apps/

Example URI

GET https://directory.service.tokenbrowser.com/v1/apps/
URI Parameters
HideShow
offset
integer (optional) Default: 0 Example: 80

Paging offset

limit
integer (optional) Default: 10 Example: 20

Page size

featured
boolean (optional) Default: false Example: true

Only return featured things

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
"offset": 0,
"query": "",
"limit": 10,
"total": 100,
"featured": false,
"apps": [
{
"token_id": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
"reputation_score": 3.5,
"review_count": 10,
"username": "testingbot",
"is_app": true,
"payment_address": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "name": "TestingBot",
  "avatar": "https://token-id-service.herokuapp.com/identicon/0x2a7f5bfe1c61c752e1cc668661f07804006678b1.png",
  "about": "..."
},
...
]
}

App Index

Fetch list of featured apps
GET/v1/apps/featured

Example URI

GET https://directory.service.tokenbrowser.com/v1/apps/featured
URI Parameters
HideShow
offset
integer (optional) Default: 0 Example: 80

Paging offset

limit
integer (optional) Default: 10 Example: 20

Page size

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
"offset": 0,
"query": "",
"limit": 10,
"total": 100,
"featured": true,
"apps": [
{
"token_id": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
"reputation_score": 3.5,
"review_count": 10,
"username": "testingbot",
"is_app": true,
"payment_address": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "name": "TestingBot",
  "avatar": "https://token-id-service.herokuapp.com/identicon/0x2a7f5bfe1c61c752e1cc668661f07804006678b1.png",
  "about": "..."
},
...
  ]
}

App

Get app
GET/v1/apps/{token_id}

Example URI

GET https://directory.service.tokenbrowser.com/v1/apps/1
URI Parameters
HideShow
token_id
string (required) Example: 1

token id of the app

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token_id": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "reputation_score": 3.5,
  "review_count": 10,
  "username": "testingbot",
  "is_app": true,
  "payment_address": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "name": "TestingBot",
  "avatar": "https://token-id-service.herokuapp.com/identicon/0x2a7f5bfe1c61c752e1cc668661f07804006678b1.png",
  "about": "..."
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
    "errors": [
        {
            "id": "not_found",
            "message": "Not found"
        }
}

Sofa Manifest

Sofa Manifest

Get Sofa Manifest
GET/v1/manifest/

Example URI

GET https://directory.service.tokenbrowser.com/v1/manifest/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "languages": [
    "en"
  ],
  "initRequest": {
    "values": [
      "paymentAddress",
      "language"
    ]
  },
  "protocol": "sofa-v1.0",
  "interfaces": [
    "ChatBot"
  ],
  "ownerAddress": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "paymentAddress": "0x2a7f5bfe1c61c752e1cc668661f07804006678b1",
  "avatarUrl": "http://icons.iconarchive.com/icons/martz90/circle/512/app-draw-icon.png",
  "displayName": "TestingBot",
  "webApp": null
}

Usage Notes

Errors

All error messages will return both machine (id) and human readable (message) error message. All errors, except validation_error, return only one error. Some errors will also have an optional link to the documentation (url).

validation_error with status code 400 is returned when the validation of the resource fails on POST or PUT requests. Response contains errors field with a list of errors.

Important: Different error types (id) can be added and removed over time so you should make sure your application accepts new ones as well.

{
  "errors": [
    {
      "id": "not_found",
      "message": "Not found"
    }
  ]
}

Generated by aglio on 18 Apr 2017