Solace Cloud REST API authentication

Options
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: 923 admin
    Options

    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 ✭✭
    Options

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

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin
    Options

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