Skip to content
ArtOfCode edited this page Sep 28, 2016 · 34 revisions

Metasmoke offers an API to access data in JSON format about posts, reasons, and feedback. This is the documentation for said API.

Getting Started

To get started, you'll need an API key. No application can use the API without a key - you'll get a 403 response. To get a key, ping a metasmoke admin in chat - they'll be able to register one for you. Have a name in mind for your app - a name is necessary to register a key. You can edit it later, so it doesn't have to be final. Also make sure that you have an active metasmoke account - this allows the registering admin to tie the key to your account, giving you control of your app.

Once you have your key, you should include it as the key query string parameter on all requests to the API.

Write Methods

Write methods additionally require you to go through OAuth to get hold of a write token, which can be used to authorize the write request. You should follow this flow:

  • Send your user to https://metasmoke.erwaysoftware.com/oauth/request?key=YOUR_KEY_HERE
  • If the user authorizes your app, they'll be given a code to provide you. Ask them to enter that code, then:
  • Send an AJAX GET request to https://metasmoke.erwaysoftware.com/oauth/token?key=YOUR_KEY_HERE&code=THEIR_CODE_HERE. The response is a JSON object containing one key, token, the value of which is your write token.

API Read Routes

API Write Routes