Forum Discussion

irach15's avatar
irach15
Maven
5 years ago

cUrl call to get data

hey,

sorry for simple questions to all API gurus 😉

I just started using cUrl for getting API data, somehow after working years as Admin and Dev never has been needed...

Being said, I want to understand how I as Admin can make a simple cUrl call to get for example all data for one user with a specific user ID.

I see all the sample under Dev docs,

but still having a situation or THE situation to code a cUrl call.

Questions:

- do I need a session-key to Get call?

- how to get a session-key?

- can I use instead of session-key another authentication method  or none because I'm an Admin and signed in at the moment of the call?

for example to get all badges from a user:

curl -X GET \
    'https://[COMMUNITY-DOMAIN]/api/2.0/users/13/badges/' \
    -H 'Authorization: Bearer [TOKEN]' \
    -H 'client-id: [CLIENT-ID]'

I got: client-id, but is Bearer [TOKEN]?

another example, for this one, how to code a curl call?

select id, name, node.id, role_status from roles where users.id = '17'

Trying to see the logic and understand how to make a call.

20 Replies