PatilShreyas/NotyKT

[Android] Implement API for updating Pin/Unpin state in Android app

PatilShreyas opened this issue · 5 comments

Currently, all work regarding the pin/unpin feature is completed. Just API call invocation implementation is pending from the android app side.

Once #541 is merged, the work on this issue can be started.

Please assign this to me, once backend issue is merged, I would love to complete this. Thanks.

I guess I replied on the wrong thread. NVM

Ref:
#547 (comment)
#547 (comment)

Hi @PatilShreyas Assign this to me

Thanks, @tyaporush for showing interest in contributing to this. Assigning this to you 😄.

@tyaporush Here's the REST API spec for you.


REST API Specification

Request

  • Method: PATCH
  • URL: BASE_URL/note/{note-id}/pin
  • Header: Authorization <TOKEN>
  • Body:
{
  "isPinned": true/false
}

Example:

PATCH https://API_BASE_URL/note/noteId1234/pin
Content-Type: application/json
Authorization: Bearer YOUR_AUTH_TOKEN

{
  "isPinned": true
}

Response

1. When note gets pinned/unpinned successfully

Response Code: 200

{
  "status": "SUCCESS",
  "message": "Note is pinned/unpinned successfully",
  "noteId": <NOTE ID>
}
2. When note note exist in system

Response Code: 404

{
  "status": "NOT_FOUND",
  "message": "Note not exist with ID '$noteId'"
}
3. When unauthorized user tries to update note pin

Response Code: 401

{
  "status": "UNAUTHORIZED",
  "message": "Access denied"
}