Dear Survey Solutions team members,
I tried to use the SuSo API with Stata and It seems that it’s not possible to access some workspaces although the API user is enabled for these workspaces. Indeed, I created a new workspace and enabled the API user for this workspace but I noticed that this new workspace is not accessible.
I saw that Zurab provided the following solution to fix this issue for the SuSo API using python:
clientA = ssaw.Client(url=‘server website’, api_user=‘expapi’,
api_password=‘password’, workspace=‘asp’)
I tried to replicate it on STATA by specifying the workspace to the STATA API client but it’s not working.
Please how can I fix this issue on the STATA API?
Dear Sergiy,
Thanks for your response.
Kindly see below the commands I used and the results on STATA.
STATA did not display any error but when trying to get the list of questionnaires from the server, I did not receive the list of questionnaires from all the workspaces, I received the questionnaires from only one workspace.
Even when I approve a completed interview (Command used: .sse.interviews_approve “42-16-50-46”), the concerned interview keeps its status Completed. No approval is done on the server.
Stata displayed error: 9999 “assignment of a reference is not allowed”. It is not clear where it is coming from Stata itself, or Python, or something else.
Try with -set trace on- to see where the error is issued in the code.
Try with Stata 16, as this has not been tested against Stata 17.
Your screenshot shows that the error is while creating the client object, still before any action, while you write that you’ve “received the questionnaires from one workspace”. I can’t put these two together.
Dear Sergiy,
Thanks for your reply and your assistance.
I used the command you shared on STATA 17 and I got the results attached. I went through the results but I can’t see where the error comes from. Maybe it’s the version of STATA?
Yes Sergiy, I received the questionnaires from one workspace as you can see on
the screen below.
I could not reproduce the problem with the posted information using the most recent version of the API client posted at GitHub, please update if necessary. When I run the same I am getting a response from the server that there are 4 supervisors defined in the primary workspace, and their logins are ending with 6SK2, 7SK7, 8SK2, and 9SK2.
I do not understand how the log shown corresponds to the topic of the question which was about “some workspaces”. This API user is given access to only the primary workspace, so must fail with any other.
The message that you are seeing on the screen “assignment of a reference is not allowed” is not coming from my code.
Hi Sergiy,
I’m really happy to inform you that everything is working fine now. I just added the workspace that I needed to the address.
Many thanks for your valuable support.