Skip to end of metadata
Go to start of metadata

User API

 

Razuna Hosted Platform

Only users in the Administrator group are allowed to use these API calls.

Add a User

Method

Method Name

Returns

add

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

user_first_name

First Name of the user

String

yes

John

user_last_name

Last Name of the user

String

yes

Doe

user_email

eMail of the user

String

yes

john@doe.com

user_name

User name of the user

String

yes

john

user_pass

Password of the user

String

yes

john1doe (password will be MD5 hashed)

user_active

Activate the user

String

no

T = true
F= false (default)

groupid

Groupid (ID of the Group you want the user to belong to)

String

no

0 = no group (default)
2 = Administrator
any other number for your custom groups

Can not add System Administrator group (groupid 1)

Output Value

Name

Description

Sample Output

Version

Responsecode

A result code with the status of the login. If the result is 0 the method was successful.

0

 

Message

Reply text

User has been added successfully

 

UserID

Returns the users id

108

Razuna 1.4.5

apikeyReturns the api key for this user (only for users in "administrator" group)
54592180064BC7466F4B2F943
Razuna 1.5

REST: Sample Request

Sample Output

Update User Information (as of Razuna 1.5)

Method

Method Name

Returns

update

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

userid*

ID of user to update

String

no

Used as a search string, can be left empty

userloginname*

userloginname of user to update

String

no

Used as a search string, can be left empty

useremail*

eMail of user to update

String

no

Used as a search string, can be left empty

userdata

A JSON string of data to update

String

yes

See below for fields in JSON

Word on user fields

The API will do a search on the user to update. Thus provide a value for one (only one) of userid, userloginname or useremail fields! If the user could be found, the API will update the records, if not you will receive an error message.

Output Value

Name

Description

Sample Output

Response

A result code with the status of the login. If the result is 0 the method was successful.

0

Message

Result message

Update successful

Userdata parameters

You have to use a JSON structure to pass the user fields to be updated. Below are the fields available:

User fields

Note

user_login_name

 

user_first_name

 

user_last_name

 

user_email

 

user_pass

(you need to MD5 hash the password !!!!)

user_active

(T = true, F = false)

group_id

(provide the groupID! Leaving this field empty, will remove all groups for the user)

These fields can be freely used, meaning you can combine the fields as you like

REST: Sample Request

Sample Output

Get User Information (as of Razuna 1.3.5)

This returns the user information of the current user logged in via the API!

Method

Method Name

Returns

getuser

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

Output Value

Name

Description

Sample Output

user_first_name

First Name of the user

John

user_last_name

Last Name of the user

Doe

user_email

eMail of the user

john@doe.com

user_login_name

User name of the user

john

user_id

ID of the user

108

user_api_keyAPI key for this user54592180064BC7466F4B2F943

REST: Sample Request

Sample Output

Output format

Remember you can adjust the output dynamically. The API returns JSON by default. For record sets it defaults to a ROW based set, if you need COLUMNS simply append "&__BDQUERYFORMAT=column" to your call. In case, you need JSONP you want to append "&__BDRETURNFORMAT=jsonp&callback=?". In order to retrieve XML (WDDX) you simply need to append "&__BDRETURNFORMAT=wddx".

Delete User (as of Razuna 1.5)

Method

Method Name

Returns

delete

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

userid*

ID of user to update

String

no

Used as a search string, can be left empty

userloginname*

userloginname of user to update

String

no

Used as a search string, can be left empty

useremail*

eMail of user to update

String

no

Used as a search string, can be left empty

Word on user fields

The API will do a search on the user to update. Thus provide a value for one (only one) of userid, userloginname or useremail fields! If the user could be found, the API will delete the record, if not you will receive an error message.

Output Value

Name

Description

Sample Output

Response

A result code with the status of the login. If the result is 0 the method was successful.

0

Message

Result message

Update successful

REST: Sample Request

Sample Output

  • No labels

6 Comments

  1. Anonymous

    Hello Nitai,

    add method of user api2 is throwing below error:

    API Call:

    http://192.168.71.132:8080/razuna/global/api2/user.cfc?method=add&api_key=63AC9696F3E14EA89B233E570B337B8B&user_first_name=Tapan&user_last_name=Thapa&user_email=tapan.thapa@yahoo.com&user_name=tapan&user_pass=tapan&user_active=F&groupid=0

    Error:

    {"message":"arguments.sessiontoken doesn't exist.","errorcode":"","detail":"Error at line 1, column 1"}

    Please suggest.

    Regards

    Tapan Thapa

    1. Argh... our test worked out and then we checked in the wrong component. Sorry about that. The correct file is now in github.

  2. Anonymous

    Hello Nitai,

    update method of user api2 is having wrong sample request url.

    Current:

    /global/api2/user.cfc?method=update&api_key=54592180-7060-4D4B-BC74-2566F4B2F943&useremail=user@domain.com&userdata=[["user_first_name","Joe"],["user_last_nama","Banana"]]
    Actual:
    /global/api2/user.cfc?method=update&api_key=54592180-7060-4D4B-BC74-2566F4B2F943&useremail=user@domain.com&userdata=[["user_first_name","Joe"],["user_last_name","Banana"]]
    Thanks
    Regards
    Tapan Thapa
    1. Anonymous

      Please make a note that one of the filed parameter (userid,userloginname,useremail) under update method of user api should be mandatory (i think).

      Second i have tried update user account with userid and userloginname but via both parameters, user account info don't get updated and i used to get below error:

      {"responsecode":1,"message":"User with the ID could not be found"}

      If i am using useremail parameter (as per doc) then account info is getting updated properly.

      Please look into this.

      Regards

      Tapan Thapa

      1. Hi,

        As per description above it says "Thus provide a value for one (only one) of userid, userloginname or useremail fields!"

        In that regard really only provide ONE value (for now).

        Thanks.

    2. Example has been corrected. Thanks.