Hi Wazo developer,
Thank you very much for your hard work on the great Wazo product.
I am new and trying to learn wazo, I installed the class 5 United communication locally and I can access the server from web-ui and create users, context, lines, incalls etc, and also I can access the api web-ui: https://localhost/api, but I have questions about the API web-ui.
from the document documentation-wazo-community-en-latest.pdf, on page 239, it talks about how to Create a wazo-auth user and policy:
POST /users {“purpose”: “external_api”, “username”: “rest-api-test”, …}
POST /policies {“acl_templates”: ["#"], …}
PUT /users/{user_uuid}/policies/ {policy_uuid}
-
My first question is since there are “…” in the commands, so what are the full commands for posting users and policies? also where to get user_uuid? I created a few users from web-ui http://localhost/engine/users/ but there is no user_uuid, only username.
-
There are a list of Available APIs on the left of the api page, when I clicked on wazo-auth, the top field box changed to url: https://localhost:9497/0.1/api/api.yml and in the token box next to Explore, I put in the user info: rest-api-test:password, then I clicked Token to create a token with body:
{
“access_type”: “online”,
“backend”: “wazo_user”,
“expiration”: 10
}
I created the token successfully, which is 81286eeb-24c8-43a2-9ccd-20a5117f8a7d, but when I used this token to get token:
curl -X GET --header ‘Accept: application/json’ ‘https://localhost:9497/0.1/token/81286eeb-24c8-43a2-9ccd-20a5117f8a7d’
IT said {
“reason”: [
“No such token”
],
“timestamp”: [
1580873528.1772726
],
“status_code”: 404
} -
Get tokens:
curl -X GET --header ‘Accept: application/json’ ‘https://localhost:9497/0.1/tokens?recurse=false’
I got Unauthorized
Response Body
{
“message”: “Unauthorized”,
“error_id”: “unauthorized”,
“details”: {
“invalid_token”: “”
},
“timestamp”: 1580873549.8123991
}