question

Prathikmalpe-8606 avatar image
0 Votes"
Prathikmalpe-8606 asked SatishBoddu-MSFT commented

Azure Sphere rest api's issue

Hello. I was able get the resource groups using bearer token.

179673-image.png

But I couldn't figure out how to run the API's using https://prod.core.sphere.azure.net/ to get tenant details and move device to different group.

Please provide more info on this. Thank you




azure-iot-sdk
image.png (73.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

asergaz avatar image
0 Votes"
asergaz answered SatishBoddu-MSFT commented

Hello @Prathikmalpe-8606 are you testing as described here: Tenants Get?

GET https://prod.core.sphere.azure.net/v2/tenants/{tenantId}

See also: Authentication library values

If you call the Active Directory Libraries to acquire a Bearer Token to use for authentication, you must supply four values:
- Azure Sphere client application ID: 0b1c8f7e-28d2-4378-97e2-7d7d63f7c87f (required for successful authentication)
- Scope for the user: https://sphere.azure.net/api/user_impersonation
- Azure Sphere Tenant ID: 7d71c83c-ccdf-45b7-b3c9-9c41b94406d9
- Azure Sphere API endpoint: https://prod.core.sphere.azure.net/

Thanks




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes. I have used the same API you mentioned by providing those 4 values in the body. Do i have to add any pre-request script or header values?
Thank you

0 Votes 0 ·

Thanks for the response asergaz.
How can I generate the bearer token. Is the pre-request script for it available?

Thank you.

0 Votes 0 ·