Skip to content

Instantly share code, notes, and snippets.

@ryo33
Last active May 11, 2017 13:28
Show Gist options
  • Save ryo33/145e5ef24bad6f11abbb902edc6979d6 to your computer and use it in GitHub Desktop.
Save ryo33/145e5ef24bad6f11abbb902edc6979d6 to your computer and use it in GitHub Desktop.
sha.herokuapp.com API

API

Get your SECRET from /profile/api.

Examples

Create a token

PUT /api/users/USER_ID

Headers

Content-Type: application/json

Parameters

secret=USER_SECRET

Response

{
  "user": {
    "id": USER_ID,
    "name": USER_NAME,
    ...
  },
  "token": TOKEN,
  "exp": TIME_OF_EXPIRATION,
  ...
}

Submit a post

PUT /api/users/USER_ID/post

Headers

Authorization: Bearer TOKEN
Content-Type: application/json

Parameters

text=TEXT
[post_id=POST_ID_TO_REPLY
 | address=USER_ID_TO_ADDRESS]

Response

{
  "post_id": POST_ID,
  ...
}
Copy link

ghost commented May 11, 2017

Submit a post の PUT /api/users/USER_ID/post は POST /api/users/USER_ID/post であるべき。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment