-
Notifications
You must be signed in to change notification settings - Fork 1
User Routes
Hong edited this page May 24, 2020
·
3 revisions
Endpoint: user/{id}
Method: GET
Description: This API gets a single user.
Parameters | Format |
---|---|
id | spotify userid |
example request URL: https://localhost:3001/user/12583452
STATUS CODE: 400 NOT FOUND
User not found
STATUS CODE: 200 OK
- Returns the user
example response
{
spotifyUserId: 390FGD84JD,
displayName: Dinith,
profilePic: image.png,
friends: [Hong, Nisarag],
isPrivate: false,
refreshToken: 234324b62346b4256b4586,
accessToken: 24213v2329234923435b456,
}
Endpoint: user/{id}
Method: PUT
Description: This API gets a single user.
Parameters | Format |
---|---|
user | user object |
example body
{
spotifyUserId: 390FGD84JD,
displayName: Dinith,
profilePic: image.png,
friends: [Hong, Nisarag],
isPrivate: false,
refreshToken: 234324b62346b4256b4586,
accessToken: 24213v2329234923435b456,
}
example request URL: https://localhost:3001/user
STATUS CODE: 400 NOT FOUND
User not found
STATUS CODE: 200 OK
- Returns the updated object
example response
{
spotifyUserId: 390FGD84JD,
displayName: Dinith,
profilePic: image.png,
friends: [Hong, Nisarag],
isPrivate: false,
refreshToken: 234324b62346b4256b4586,
accessToken: 24213v2329234923435b456,
}