Maintain control of your Microsoft 365 data
Post Reply
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Restful API - License limitations?

Post by dan.kennedy »

I'm trying to pull some info from RestAPI but keep getting "Authorization has been denied for this request."

Would this be caused by a license limitation of any sort? I'm running this against a test VBO365 server i spun up and have tried it with an evaluation license and also an NFR but get the same "authorization denied" response no matter what i try!

I can get to the SwaggerUI and generate a token with the same credentials and it works fine, but it seems like I can't query any of the other operations for some reason?
nielsengelen
Product Manager
Posts: 5905
Liked: 1236 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Restful API - License limitations?

Post by nielsengelen »

Looks like u requested a token and didn't authenticate with the token (in the Swagger UI you can do this on top of the screen). As a result, you get access denied since you aren't correctly authenticated. Requesting the token is not the same as the actual authentication process. This is also described in the user guide.
GitHub: https://github.com/nielsengelen
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Re: Restful API - License limitations?

Post by dan.kennedy »

I didn't realise you need to click "explore" again after generating the token - Thanks!
(Still doesn't work from my bash script but it at least proves RestAPI is working OK on my test box)
jmartinez191
Lurker
Posts: 2
Liked: never
Joined: Jul 13, 2021 7:30 pm
Full Name: Jonathan Martinez
Contact:

[MERGED] Veeam Backup Office 365 Configurations Audits

Post by jmartinez191 »

Hi,

I tried configured Configurations Audits notifications but in the swagger, response body apperar this:

{
"message": "Authorization has been denied for this request."
}
Polina
Veeam Software
Posts: 3461
Liked: 830 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: Restful API - License limitations?

Post by Polina »

Hi Jonathan,

I moved your topic to the existing thread on a similar issue.
Please check the above posts.
flavio.santos
Enthusiast
Posts: 32
Liked: 5 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

Re: Restful API - License limitations?

Post by flavio.santos »

Hi dan.kennedy,

First, you need to call the Auth API, to get the authorization token (Ok, it seems that you know that):

POST: https://<your_vbo_server_ip>:4443/v5/Token

in the body, you should send the user and password for authentication (send it in raw / Text):

grant_type=password&username=your_user&password=your_pass

Executing that, you should receive something like:

Code: Select all

{
    "access_token": "AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAaRAn9waDe0iSxJcO1wHcdgAAAAACAAAAAAAQZgAAAAEAACAAAAD15akPneB-AmdZk80oqI71NRBO7XNT0Ox_IjxkOUlGfAAAAAAOgAAAAAIAACAAAADSOOJk4XhCsvCYjhkC-4X1_cmE2OV_kyT2q6sU6IuAb7AAAAA8Dx73ZOrk3TfjZo-WV2dolTsHZmbNqepNtPtg9ayMn__Lv0LWjmFlsgZ64_-D3i2oAmczx00dw1RW6LtL5MF9xacGiMIeC-ArrfgKFnarnJg28JkxvxTTV0ozCStoRbtMuUTSrxrv1OsiHSrIlHWYtn4SHS8i9YHf_O22_xAOrO4MwxCLeuY5he7OHRd4Y9FHxz1N8qjyOcmQCXe2hqw0obShSK0P2pGqsH8y3w5jNUAAAACUDpPhTZufd3c3LjethRKgNK03v8hxO-zozZC5DtgDwkeQU6mrnU5pT9cNynEOJyDi13Q_CdI7KB8rrnKwAd4p",
    "token_type": "bearer",
    "expires_in": 3599,
    "refresh_token": "AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAaRAn9waDe0iSxJcO1wHcdgAAAAACAAAAAAAQZgAAAAEAACAAAABVSN5thSv5ezByXsMOHUBgcr9Bd4uoZ1uw5QorphtIuQAAAAAOgAAAAAIAACAAAADd9-YqExkpIRE43GDNvMtT__xduVA-r4mlMeXwzwa_9dAAAABcLmmlKYJmZnWQnKyHXN4yVb194HEXaSPMllS-BHRIZ0ia9D_kaeump7-0Y3zRqsLtlIvmk0upvISFSzNBs68OuOIqqUXXsaiwCH7oguPQdSAysq1OZ21mLJc0JjdpUXkrFEKyFZnI0PxMBOg86eD8JakQldECailNLX5gzSo6kdSmaXshdjEMDQa1P5N8kYCbVUmMIUFegLvPJd6GZmT5bAQlSeybYh9hYrKsA-LCRj6iZmUTURrhoHMPTs4BWyH_OBYZ6MeUO1hJNl_YXY6lQAAAAAZja_eSFmMewssTSwn4-ItekN-II9xXPJvJBWEN0pOTcT-4k0dFa5jxnntp95DiWUp5JcAtXwAZrZdoqooQCFY",
    ".issued": "Wed, 01 Sep 2021 19:12:41 GMT",
    ".expires": "Wed, 01 Sep 2021 20:12:41 GMT"
}

This access_token, you must send it in the next API call you want.

like for instance, if you want to know the proxies you have available:

GET https://<your_vbo_ip>:4443/v5/Proxies

Header:
Authorization: Bearer AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAaRAn9waDe0iSxJcO1wHcdgAAAAACAAAAAAAQZgAAAAEAACAAAAD15akPneB-AmdZk80oqI71NRBO7XNT0Ox_IjxkOUlGfAAAAAAOgAAAAAIAACAAAADSOOJk4XhCsvCYjhkC-4X1_cmE2OV_kyT2q6sU6IuAb7AAAAA8Dx73ZOrk3TfjZo-WV2dolTsHZmbNqepNtPtg9ayMn__Lv0LWjmFlsgZ64_-D3i2oAmczx00dw1RW6LtL5MF9xacGiMIeC-ArrfgKFnarnJg28JkxvxTTV0ozCStoRbtMuUTSrxrv1OsiHSrIlHWYtn4SHS8i9YHf_O22_xAOrO4MwxCLeuY5he7OHRd4Y9FHxz1N8qjyOcmQCXe2hqw0obShSK0P2pGqsH8y3w5jNUAAAACUDpPhTZufd3c3LjethRKgNK03v8hxO-zozZC5DtgDwkeQU6mrnU5pT9cNynEOJyDi13Q_CdI7KB8rrnKwAd4p

This token will work for 1 hour only, after that you need to refresh it (see https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50).

If you prefer the curl commands:

Token:

Code: Select all

curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'grant_type=password&username=your_user&password=your_pass' 'https://<your_vbo_ip>:4443/v5/token'

Proxy:

Code: Select all

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAaRAn9waDe0iSxJcO1wHcdgAAAAACAAAAAAAQZgAAAAEAACAAAAB_IaDRZkiMoaDYpE1J9GEHRoppKWxxXnFCAPjStJu0wQAAAAAOgAAAAAIAACAAAADqDY_U_GWuOOenupKaP_GafpUo5q0OqytfGy2c3tGULLAAAACIDGffI7gQ8MF6dL_RY6y4fjyX0QW5Vsor1l60rW60yYviKvizHYnSj-u7JdyaY6LmSWTigjt8c8SS9LW5DF2daCjjvRMSW4L5P8A0PYqsA3wSItQnCKt4CMI302Z4FULeKyCtb2PCWvAushhoMZ-iA34P7TqYOkLypLb_HTxl9i2z9931xW6oeJXVOrcQKe5jnxTY532F-XGa9z8cJjavZrOex58ApD6AbElL9obxdEAAAABm7_dZTO3uTLZG585_psfXE2WBcdE7wmWOzOGeuBkXO7v15IZARWR7MU5cegBtRGQ6CoUqXCplK6Ar9g6A1H3P' 'https://<your_vbo_IP>:4443/v5/Proxies'
jmartinez191
Lurker
Posts: 2
Liked: never
Joined: Jul 13, 2021 7:30 pm
Full Name: Jonathan Martinez
Contact:

Re: Restful API - License limitations?

Post by jmartinez191 »

Hi,

I tried but V5/Organizations

Reponse body

{
"message": "Authorization has been denied for this request."
}
nielsengelen
Product Manager
Posts: 5905
Liked: 1236 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Restful API - License limitations?

Post by nielsengelen »

That means you didn't request a token and authenticated against the API with that token. Please read up on the previous posts on this topic on how to utilize the API or have a look at this blog post.
GitHub: https://github.com/nielsengelen
Post Reply

Who is online

Users browsing this forum: No registered users and 108 guests