system
March 29, 2021, 1:13am
1
Migrated from Redmine #677 | Author: Michelle Thomas
Status: New | Priority: High, I’m very impatient | Created: 2021-03-29
Hi,
Can we get auth token for admin login using API key ? The only example for admin auth in the docs use login and password which we don’t want to use.
We are vip customer, does that change api url that we use?
Below is the code we intend to replace with API Key
POST https://user-api-v2.simplybook.me/admin/auth
Content-Type: application/json
{
"company": "",
"login": "",
"password": ""
}
system
March 29, 2021, 4:21am
2
Michelle Thomas wrote:
Noting that our booking page is michaelhillau.simplybook.vip and NOT michaelhillau.simplybook.me - therefore, should we be using a different API URL at all?
Our previous ticket didn’t receive suitable support and was closed prior to a resolution on our side, so we have had to create a new ticket to get this resolved quicker. I have also advised our success manager, Alex, of this issue ticket. Thanks
system
March 29, 2021, 5:55am
3
Dmytro Bondarev wrote:
There is no way to get token using API key.
You have to use user credentials.
system
March 29, 2021, 10:13pm
4
Michelle Thomas wrote:
Dmitry Bondarev wrote:
There is no way to get token using API key.
You have to use user credentials.
Hi Dmitry,
We created additional user with admin role and tried to use above method to get auth key. We are getting below error
Ouch!
ERROR
I’m sorry, that page is in another universe!
Our booking page is michaelhillau.simplybook.vip - does it change the api url we have to use?
Does additional user with Admin role can access admin api?
Thanks
system
March 30, 2021, 4:08am
5
Michelle Thomas wrote:
Michelle Thomas wrote:
Dmitry Bondarev wrote:
There is no way to get token using API key.
You have to use user credentials.
Hi Dmitry,
We created additional user with admin role and tried to use above method to get auth key. We are getting below error
Further to this.
We tried to get Auth Token using api url https://user-api-v2.simplybook.vip/admin/auth and got success.
But, we are still facing issues with below command
POST - https://user-api-v2.simplybook.vip/admin/bookings
X-Company-Login - mixxxxxxxu
X-Token - Token
I’m getting Unauthorized 401 error
system
March 30, 2021, 6:53am
6
Redmine Admin wrote:
please make sure this user have access to view bookings
system
March 30, 2021, 7:38am
7
Dmytro Bondarev wrote:
Please provide HTTP request. Please note that you should use POST to make booking and GET to get bookings.
system
March 30, 2021, 10:25pm
8
Michelle Thomas wrote:
Dmitry Bondarev wrote:
Please provide HTTP request. Please note that you should use POST to make booking and GET to get bookings.
We are still receiving Unauthorised error
HTTP Request
Get Auth Token
POST https://user-api-v2.simplybook.vip/admin/auth
Content-Type: application/json
{
“company”: “michaelhillqld”,
“login”: “username”,
“password”: “password”
}
Get bookings
GET https://user-api-v2.simplybook.vip/admin/bookings
Content-Type: application/json
X-Company-Login: michaelhillqld
X-Token: tokenfromauthrequest
Unauthorised error
I have seen working example using same code but none of those use .vip.
Can you please double check on this?
system
March 31, 2021, 7:20am
9
Dmytro Bondarev wrote:
Hi! I have checked it works fine.
And it looks like you are calling logout method somewhere, in this case token will not be valid anymore and you will get 401 error.
system
April 1, 2021, 6:34am
10
Michelle Thomas wrote:
Dmitry Bondarev wrote:
Hi! I have checked it works fine.
And it looks like you are calling logout method somewhere, in this case token will not be valid anymore and you will get 401 error.
Thanks Dmitry,
We can import data from Apis now. Thanks for all your help