Unable to Query Certain Endpoints with Discourse API
Ryan_NR is experiencing issues with the Discourse API, receiving errors such as “You need to be logged in to do that” and “You are not permitted to view the requested resource.” Despite using an admin user account and confirming the API key and username, the problem persists.
codinghorror suggests that the issue may be related to incorrect credential sending, while blake recommends passing API credentials in the request header instead of query parameters.
Ryan_NR is using a Postman collection downloaded from the Discourse API documentation, but blake notes that some of these collections may be outdated.
After trying blake’s suggestion, Ryan_NR still encounters the same error. blake shares a working curl command for the group members API request, suggesting that Ryan_NR compare it with their Postman setup.
You could try passing the api credentials in the header of the request instead of the query params. There should be an example in the api documentation topic.