Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 1.76 KB

doc.md

File metadata and controls

98 lines (77 loc) · 1.76 KB

Documentation

Get auth token

Request:

curl -X POST -d '{
    "username" : "changeme",
    "password" : "changeme"
}' "http://127.0.0.1:8080/auth/signin"

Response

{
  "username": "changeme",
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjaGFuZ2VtZSIsInJvbGVzIjoiUk9MRV9VU0VSLFJPTEVfQURNSU4iLCJpYXQiOjE2NDQyNDEwNjYsImV4cCI6MTY0NDI0NDY2Nn0.0WBE_YwiYPWWEL3J6JT8WLJP-quOKScqcRx4zna2LyM"
}

Send verification email

curl -X POST "http://127.0.0.1:8080 /api/v1/[email protected]"

Response

{
  "id": "e3608186-5c09-45c3-9dfe-e52754ab2cb3",
  "address": "[email protected]",
  "code": "776247",
  "sendTime": "2022-02-07T17:31:13.925822",
  "validTime": "2022-02-07T17:36:13.925822"
}

Validate the code

curl -X GET "http://127.0.0.1:8080 /api/v1/[email protected]&code=980122"

Response

{
  "valid": true
}

Get a list of all codes

curl -X GET "http://127.0.0.1:8080 /api/v1/emails"

Response

[
  {
    "id": "d7c7d0be-46b9-4d22-a20a-6b8e0d005b93",
    "address": "[email protected]",
    "code": "980122",
    "sendTime": "2022-02-07T17:28:58.886417",
    "validTime": "2022-02-07T17:33:58.886417"
  },
  {
    "id": "e3608186-5c09-45c3-9dfe-e52754ab2cb3",
    "address": "[email protected]",
    "code": "776247",
    "sendTime": "2022-02-07T17:31:13.925822",
    "validTime": "2022-02-07T17:36:13.925822"
  }
]

Get a single email by id

curl -X GET "http://127.0.0.1:8080 /api/v1/email/d7c7d0be-46b9-4d22-a20a-6b8e0d005b93"

Response

{
  "id": "d7c7d0be-46b9-4d22-a20a-6b8e0d005b93",
  "address": "[email protected]",
  "code": "980122",
  "sendTime": "2022-02-07T17:28:58.886417",
  "validTime": "2022-02-07T17:33:58.886417"
}