GET /v1/spaces/:space_id/users not works

35 views
Skip to first unread message

Fernando Poyato

unread,
Feb 17, 2014, 7:20:56 AM2/17/14
to assembla...@googlegroups.com
When I try to get info about all users in a space the servers return a 403 error.

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 7:57:45 AM2/17/14
to assembla...@googlegroups.com
Hi Fernando,

can you show the request you're making? 403 usually means you don't have enough permissions for that action. I just fetched the list of users in a project I'm an owner of.

Regards,
Stanislav


On 02/17/2014 02:20 PM, Fernando Poyato wrote:
When I try to get info about all users in a space the servers return a 403 error.
--
You received this message because you are subscribed to the Google Groups "Assembla API Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to assembla-api-d...@googlegroups.com.
To post to this group, send email to assembla...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Fernando Poyato

unread,
Feb 17, 2014, 9:39:39 AM2/17/14
to assembla...@googlegroups.com

file_get_contents(https://api.assembla.com/v1/spaces/aaR0S8E4Cr4OHTacwqjQWU/users): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden


In case of getting info about one user by id the server returns a 200 response.

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 9:43:07 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Does the user you're making the request with have enough permissions in this project?

Regards,
Stanislav


On 02/17/2014 04:39 PM, Fernando Poyato wrote:

file_get_contents(https://api.assembla.com/v1/spaces/aaR0S8E4Cr4OHTacwqjQWU/users): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden


In case of getting info about one user by id the server returns a 200 response.

Fernando Poyato

unread,
Feb 17, 2014, 9:44:25 AM2/17/14
to assembla...@googlegroups.com, Fernando Poyato
Yes

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 9:50:29 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Then there is no reason to get 403.

Regards,
Stanislav

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 9:51:28 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Can you please make the same request with curl and show me the command so that I can check it on my side?

Regards,
Stanislav

On 02/17/2014 04:44 PM, Fernando Poyato wrote:

Fernando Poyato

unread,
Feb 17, 2014, 10:07:41 AM2/17/14
to assembla...@googlegroups.com, Fernando Poyato

curl -H "X-Api-key: xxxxxxxxxxx" -H "X-Api-secret: xxxxxxxxxxxxxxxxxxxxxxx" https://api.assembla.com/v1/spaces/space/users

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 10:08:33 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Does that request work for you? What's the response status?


On 02/17/2014 05:07 PM, Fernando Poyato wrote:

curl -H "X-Api-key: xxxxxxxxxxx" -H "X-Api-secret: xxxxxxxxxxxxxxxxxxxxxxx" https://api.assembla.com/v1/spaces/space/users

--

Fernando Poyato

unread,
Feb 17, 2014, 10:22:34 AM2/17/14
to assembla...@googlegroups.com, Fernando Poyato
with curl I get no response in console

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 10:28:02 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Please add a -i flag to your curl command in order to see headers and response status. Also, from what I'm seeing, you aren't passing any credentials when performing the API call from PHP. That's the reason for getting 403. Can you please fix your code and try again?

Regards,
Stanislav

Fernando Poyato

unread,
Feb 17, 2014, 10:35:41 AM2/17/14
to assembla...@googlegroups.com, Fernando Poyato
The response is 403 Forbbiden and yes, i'm passing de credentials.I use de same function to call API in all methods.

Stanislav Kolotinskiy

unread,
Feb 17, 2014, 10:37:49 AM2/17/14
to Fernando Poyato, assembla...@googlegroups.com
Well, looks like your code doesn't work correctly in some cases. As I already mentioned, I'm able to successfully perform the same call with curl and the right credentials. Please fix the code and try again.

Regards,
Stanislav
Reply all
Reply to author
Forward
0 new messages