API¶
Planning REST API¶
The new REST API is now under planning and heavy development. Any update or announcement in the future will be published here.
Planning¶
- API Token.
- Remove all sessions.
- User self info
- GET
- POST: bank, resume, address, dietary habit, real profile
- Get users public info
- List all projects.
- Creat a project.
- Update traffic subsidy.
- List all Teams.
- Create a new team.
- Add / delete chiefs
- Add / delete members.
- List available forms.
- List all tasks.
API Docs¶
The interactive API docs are provided by Swagger UI included in fastAPI.
- Docs: https://volunteer.coscup.org/api/docs
- ... or Redoc style.
Getting started¶
Creating an application¶
Right now we do not support the application identifier way to create the volunteer app, but we are working in progress.
User authorization¶
- Get the temporary and ont-time-use exchange username, password from here.
- Submit a POST request to /api/token to get the api token.
- Submit the request with a header
Authorization
with a value ofBearer
plus the api token. - ... or make a try in the api docs.
Deprecated API¶
Warning
The api endpoint of /members
is deprecated, using /members/{pid}
instead.
GET /members¶
To show all the members in the project.
Name | Type | Description |
---|---|---|
pid |
string |
Project ID |
- Status:
200
- Content Type:
application/json
{
"data": [
{
"name": "總召組 - General Coordinator",
"tid": "coordinator"
"chiefs": [
{
"email_hash": "86d3bee674f1962af04b0192f0c959f3",
"name": "球魚/Ballfish"
},
{
"email_hash": "9c08215f31eb6005a25be6521bf47b0a",
"name": "Denny Huang"
},
{
"email_hash": "4b0cdd9418513546c11c12f181f51c0f",
"name": "Toomore"
}
],
"members": [
{
"email_hash": "80bba454a8b37dba920e8787f78b3b81",
"name": "Singing"
},
{
"email_hash": "8ba17c693edf1f29ae77d64443ac242e",
"name": "nfsnfs"
}
],
},
...
]
}