[#1010] What steps are needed to access the Company administration service methods

Migrated from Redmine #1010 | Author: Simply Bookme Prikkl
Status: New | Priority: High, I’m very impatient | Created: 2023-02-09


So far I can use the methods from Company public service by getting a token (getToken) and use this token in the X-Token header together with the X-Company-Login.

When I want to use methods from Company administration service I always receive Access denied. I create a token by calling getUserToken and use this token in X-Token together with the X-Company-Login.

Is there something I am missing or did I misread anything?

Please help me out here.

An example of a Postman call I am trying to make for the method setWorkDayInfo setWorkDayInfo is:

POST: https://user-api.simplybook.me/admin
Headers:
Content-Type: application/json
X-Company-Login: name
X-Token: token
Body :

{
    "jsonrpc": "2.0",
    "method": "setWorkDayInfo",
    "params": [
        {
            "start_time": "12:00",
            "end_time": "18:00",
            "is_day_off": 0,
            "breaktime": [
                {
                    "start_time": "14:00",
                    "end_time": "15:00"
                }
            ],
            "index": "",
            "name": "",
            "date": "2023-02-10",
            "unit_group_id": "3",
            "event_id": ""
        }
    ],
    "id": 1
}

Redmine Admin wrote:

Please check User/Admin API (Company administration service) authorization section here API documentation | SimplyBook.me Online Scheduling

Simply Bookme Prikkl wrote:

I did have a look at it and tried again.

I get a token by calling getUserToken, I then use this token in the X-Token header together with the X-Company-Login. Next I make the call on the endpoint https://user-api.simplybook.me/admin/

Unfortenately I still receive an Access denied.

Does the user nedd specific rights? It is now a senior employee.

Thanks again!

Redmine Admin wrote:

it must be X-User-Token as per documentation above

Simply Bookme Prikkl wrote:

OMG I am sorry. You are right.