🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

Solace Cloud REST API authentication

petegehrman
petegehrman Member Posts: 43 ✭✭

I have created an api token in my Solace Cloud account but when calling the below URL with postman/curl I am getting an authorization error. Am I missing something that I need to be doing?
https://api.solace.cloud/api/v0/services/{service-id}?apiToken={api-token}
Thanks,
Pete

Comments

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hi @petegehrman,
    I believe the issue is that the API expects the token specified as a header like Authorization: Bearer <Your New Token>

    Can you try this and see if it works for you?
    curl -X GET https://api.solace.cloud/api/v0/services -H "Authorization: Bearer <YOUR TOKEN>"

    From there you should be able to get your service ID and then query it directly.

  • petegehrman
    petegehrman Member Posts: 43 ✭✭

    Thanks @marc, that worked :) I didn't see that anywhere in the documentation.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    @petegehrman Glad it worked. And thanks for the feedback! I'll take a closer look at the docs.