Api permissions

Dear SS,
I’m able to connect to the api and see Interviews and Assignments. I can use Export to download my data. I’m having trouble with the questionnaires. When I try to access the Questionnaires using the querystring, It keeps asking for my credentials. When I cancel, I get this message: Authorization has been denied for this request.

Is it possible I have permission for everything else, but I’m not allowed to get a list of the questionnaires? I’m using this query: https://[Our name].mysurvey.solutions/api/v1/questionnaires

Please advise.
Thank you,

Is anyone there? hello

I couldn’t reproduce the issue using the description above and the demo server.

If you have authorization for one API endpoint, you should have authorization for them all.

Could you say more about how you encountered this problem?

From your description, it sounds like you may be using the SwaggerUI interactive API documentation (i.e., pages with addresses like this). If that’s the case, be sure that you connect to the SwaggerUI pages with an account that allows you to use the API (i.e., admin or API user). If the problem persists, try logging out and logging back in again, or logging in via a browser that doesn’t share your cookies (e.g., Chrome’s Icognito mode). When you canceled the pop-up window asking for your credentials, you may have ended up with an authentication problem.

If you’re accessing the API via some other means, could you please share the form of your request (but not anything sensitive like your login and password)?

Thanks Sergiy,
I’m not using the demo server. We have an assigned server. I’m not sure it is secure to post the server name here?

Hi Arthur, I’m not using the SwaggerUI, but I was trying to access my own server using the chrome browser. This did work for many of the other Get requests.

When I access using my C# project, it works!! Here is the code that works:

private string GetQuestionnaireDetails()
    string qUrl = @"https://XXXXXXX.mysurvey.solutions/api/v1/questionnaires";
    using (var httpClient = GetClient(apiLogin, apiPassword))
        using (var response = httpClient.GetStringAsync(qUrl))
            return response.Result;

Thanks for your help in getting me to think further about this!

You were probably using a browser where you were already signed in to the server with a different role.

If you close all of the browser windows and retry in a new blank incognito mode window it should behave the same.

Clearly the C# code is not suffering from the multiple windows, so it is working fine.