85 lines
1.9 KiB
HTTP
85 lines
1.9 KiB
HTTP
### Reset database
|
|
POST http://localhost:5000/reset
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"password": "123"
|
|
}
|
|
|
|
### Create a new organization
|
|
POST http://localhost:5000/org/create
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"name": "org",
|
|
"username": "username",
|
|
"full_name": "Full Name",
|
|
"email": "user@mail.com",
|
|
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtV6PE1i2vlhCAjlzTFVt\n7v96feZHl4b5ZlHwlKLdac+ULt9b1ACWFFtMwdAoFlY6u+ijt4PaEvsKx0WSNqlI\nz4WwRYjCz8tZr+52yXzD/swZ71CponI/nofMkUUtt17SBYNLNbAWcltk69FULfMF\nSPgO+AWgN4dPnGBTotoKfVhQCWWTan6sUSTYEVgLgdZov68mn5bSHZ3NppZYIsOb\nfVL+lN/kpC0BHTrgQSoKGZcBV3tbLUg724uO7j5DNCNfUcPFbCdUEkQq+zGTaaxG\nsy335YN19x8asSvs/jGv9mhJajgr3PfD+fd5DiLecDOmgcAOBPqdGWDjqP5x6ViG\ntwIDAQAB\n-----END PUBLIC KEY-----"
|
|
}
|
|
|
|
### Login (get token)
|
|
POST http://localhost:5000/user/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"username": "username",
|
|
"org": "org"
|
|
}
|
|
|
|
> {% client.global.set("token", response.body["token"]) %}
|
|
|
|
### Verify token
|
|
POST http://localhost:5000/user/login
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|
|
|
|
{
|
|
"signature": "signature"
|
|
}
|
|
|
|
### List organizations
|
|
GET http://localhost:5000/org/list
|
|
|
|
### Create a new user
|
|
POST http://localhost:5000/user/create
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|
|
|
|
{
|
|
"username": "newuser",
|
|
"full_name": "Full Name",
|
|
"email": "newuser@mail.com",
|
|
"public_key": "null2"
|
|
}
|
|
|
|
### List users
|
|
GET http://localhost:5000/user/list
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|
|
|
|
{}
|
|
|
|
### Suspend user
|
|
POST http://localhost:5000/user/suspend
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|
|
|
|
{
|
|
"username": "newuser"
|
|
}
|
|
|
|
### Activate user
|
|
POST http://localhost:5000/user/activate
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|
|
|
|
{
|
|
"username": "newuser"
|
|
}
|
|
|
|
### Logout
|
|
POST http://localhost:5000/user/logout
|
|
Content-Type: application/json
|
|
Authorization: {{token}}
|