Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(backend): verify ticket endpoint #66

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

aldy505
Copy link
Member

@aldy505 aldy505 commented Sep 30, 2023

Notes for frontend @zuramai:

Endpoint: POST /scan-tiket
Request body:

{
  "code": "string from qrcode"
}

Responses:

  • Status code 400 (bad request) -- means either invalid request body or validation error (empty string for "code" field)
  • Status code 406 (not acceptable) -- means invalid ticket
  • Status code 500 (internal server error)
    Every of these errors has the response body shape of:
    {
      "message": "Friendly text",
      "errors": "Not so friendly text",
      "request_id": "Some text to trace back to Sentry"
    } 
  • Status code 200 (ok) -- ticket is verified with response body of:
     {
       "message": "Ticket confirmed",
       "student": false,
       "email": "[email protected]"
     }

@zuramai
Copy link
Contributor

zuramai commented Sep 30, 2023

I think we need "name" field returned as well

@aldy505
Copy link
Member Author

aldy505 commented Sep 30, 2023

I think we need "name" field returned as well

@zuramai done

@WahidinAji WahidinAji merged commit b712ba0 into master Oct 2, 2023
@WahidinAji WahidinAji deleted the ref/backend/qrscan-endpoint branch October 2, 2023 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants