Ragic Logo
<< HTTP Basic authentication with Ragic API KeyTable of ContentsReturned data JSON format >>

Password authentication

Sometimes if your platform does not support HTTP Basic authentication, you can pass the user's e-mail and password as log in credentials to authenticate your program.

Please only use this when you can not authenticate with HTTP Basic Authentication.

You send a request for a session id with a valid e-mail and password. You can issue a HTTP request using the -d argument containing the id and password. The -c parameter will store sessionId in the cookie jar file specified:

curl --get -d 'u=jeff@ragic.com' \

--data-urlencode 'p=123456' \

-d 'login_type=sessionId' \

-d api \

-c cookie.txt \

-k \

https://www.ragic.com/AUTH

If authentication failed, server will return -1. If authenticated, you will receive a session id in the response like this:

2z5u940y2tnkes4zm49t2d4

If you would like to retrieve detailed info on the log in user, you can also provide an additional json=1 parameter so that Ragic will return a json object containing the details of the user.

curl --get -d 'u=jeff@ragic.com' \

--data-urlencode 'p=123456' \

-d 'login_type=sessionId' \

-d 'json=1' \

-d api \

-c cookie.txt \

-k \

https://www.ragic.com/AUTH

The returned format will look something like this:

{

"sid":"8xkz874fdftl116vkd3wgjq0t",

"email":"jeff@ragic.com",

"accounts":

{

"account":"demo",

"ragicId":25,

"external":false,

"groups":["EVERYONE","SYSADMIN"]

}

}

Top of Page
<< HTTP Basic authentication with Ragic API KeyTable of ContentsReturned data JSON format >>
Learn more about Ragic:
Why we created Ragic
Webinars
User Guide
Keep in touch:
Blog
Email
Facebook
Twitter
Ragic, Inc.
1-888-666-8037
Terms
Privacy