Skip to content

Instantly share code, notes, and snippets.

@ryo33
Created November 24, 2016 04:36
Show Gist options
  • Save ryo33/443f63870e830c17fdcab913b7ce47eb to your computer and use it in GitHub Desktop.
Save ryo33/443f63870e830c17fdcab913b7ce47eb to your computer and use it in GitHub Desktop.

Listen History API

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,
    "display": USER_DISPLAY_NAME,
    ...
  },
  "token": TOKEN,
  "exp": TIME_OF_EXPIRATION,
  ...
}

Submit a play log

PUT /api/users/USER_ID/play

Headers

Authorization: Bearer TOKEN
Content-Type: application/json

Parameters

song=SONG_NAME
artist=ARTIST_NAME
album=ALBUM_NAME

Response

{
  "play_id": PLAY_ID,
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment