OpenAuth

From KickApps Documentation

Jump to: navigation, search

Contents

Overview

This API is used to create user information. If the user does not exist in KickApps it returns a REST API token that can be used to invoke the Kickapps REST API. If the user already exists in the KickApps database, it returns the REST API token of that user. The ipaddress of the servers that invoke these calls are whitelisted by kickapps.


Syntax

http://api.kickapps.com/rest/openauth/createtoken/92366/?devId=<>&oat=<>&succUrl=<>&developerKey1=1842b4c9

Parameters

  • developerKey – the Kickapps developer key.
  • devId – The OpenAuth devId.
  • oat - OpenAuth token of an authenticated user. This token is in turn used to retrieve user information from OpenAuth API.
  • succUrl - the OpenAuth SuccUrl.

Examples

Call

http://api.kickapps.com/rest/openauth/createtoken/92366/?developerKey=1842b4c9&devId=ki1aYzbBNDhZdX_s&f=json&
succUrl=qa.kicktest.com&oat=%2FwQAAAAAAABsUycumA1HVvzRZNtLxZJ50n8dOMJjhgPF07Ls8Rnba6%2BcwmNT0wRMvls7lu22T4Xb9JD
t3IRmL6elhvP8MtqgtiZvuLQsmyp8m798C27Lz5QKf%2F4IcmDFs866VcOc
%2FtuwZxyh

Response

If the isNewUser attribute is set to 1, the user is created.

{"TOKEN":"TOfd9SQ+eFXqFEggfuAkb2D+pWHqqliquzbvFd97lFo=","isNewUser":"1","success":"kitdigital created for
92366","METHOD":"GET","PRIVILEGES":"RW","role":"MEMBER","payload_type":"json","userId":"33579771","email":"kitd
igital@aim.com","status":"1","error":"","username":"kitdigital"}

If the user already exists, the isNewUser attribute value is set to 0:

{"TOKEN":"TOfd9SQ+eFXqFEggfuAkb2D+pWHqqliquzbvFd97lFo=","isNewUser":"0","METHOD":"GET","PRIVILEGES":"RW","role"
:"MEMBER","payload_type":"json","userId":"33579771","status":"1","email":"kitdigital@aim.com","error":"","usern
ame":"kitdigital"}

If a developerKey is not passed, the following response is returned:

{"METHOD":"GET","payload_type":"json","status":"-1","error":"either developerkey is not passed or
developerKey disabled","message":"invalid"}

If any of the required parameters are missing or if the values are invalid, a status code of -1 is returned in the response:

{"METHOD":"GET","payload_type":"json","status":"-1","error":"Missing required
parameter","message":"invalid"}
{"METHOD":"GET","payload_type":"json","status":"-1","error":"","message":"invalid"}

The IP of the servers that invokes these calls should be whitelisted by kickapps. If the IP is not in the whitelist, the following error message will be returned:

{"METHOD":"GET","payload_type":"json","status":"-1","error":"Access Denied. Please contact customer 
support","message":"invalid"}