API/user accounts

From Webcamwiz
Jump to: navigation, search

Contents

Preface

This document gives an overview of the ImLive white labels API for creating new users for a white label.

This reference manual is intended for developers. It assumes that you are familiar with web programming and you are comfortable creating applications that consume web services through HTTP requests.

General and Conventions

Request Method

All API calls are performed with HTTP GET requests to the web service.

Response

The ImLive White labels API always returns standard XML document with 2 constants elements:

Status – true/false indicates if the API call succeeded or failed.

Message – in case the status is true the message will contain the return value otherwise the error message.

Parameters Encryption & Encoding

Some API methods require the data parameters to be encrypted.

Whenever this is required, encryption and encoding steps should be performed as following:

  • Encryption method: AES
  • Cipher: CBC
  • Padding Mode: Zeros
  • Vector: 146, 64, 191, 111, 23, 3, 113, 119, 231, 121, 252, 112, 79, 32, 114, 156
  • Key: Provided key
  • Encoding: UTF8
  • Parameter Construction:
    • Construct the required JSON data object.
    • Encrypt the JSON object.
    • Convert the encrypted string to Base64 string.
    • URL encode the result string.

HttpURLEncode(ConvertToBase64String(AESEncryption(JSON)))

API Calls

Login

Description

Get a URL link that auto logins the user to his WL account.

Sample call

http://MYDOMAIN.com/webapi/Login/?data= 6RwFH5raoCFukPC5gqDkaV9d0u6KT80rCArzLsuMzSqqF7CWHkr8sMcsS1UobkD7

URL path

http://MYDOMAIN.com/webapi/Login/

Parameters

Parameter name

Parameter type

data

encrypted JSON object (see “Parameters Encryption & Encoding”)

Parameters structure

data

Name

Type

Notes

userid

Long

User ID

timestamp

Long

the current Unix timestamp (seconds since midnight, January 1st

, 1970) in UTC

Example:

{

 "userid": "123456",
 "timestamp": "1405005375"

}

Prepare the request data parameter

The JSON object should be built from the data parameters described above and then processed as described in “Parameters Encryption & Encoding”.

Return value

Upon successful login, an auto-login URL is returned. Redirecting to this URL on the client side will open the webcam site with the user already logged in.

The URL can be used one time only and is valid for 30 seconds after generated.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message></Message http://MYDOMAIN.com/Services/EntryPoint.ashx?code=a0cf1bf9-af70-4aa6-82b5-65c48fdfdec2</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/"><Message>500 - Invalid data (Invalid length for a Base-64 char array or string.)</Message><Status>false</Status></WebApiResponse>

Error Messages

  1. 101 - Invalid data
  2. 102 - internal system error
  3. 103 - user doesn't exist
  4. 104 - Invalid time stamp
  5. 105 - Internal error

RegisterUser

Description

Registers a new user in the system without adding billing information.

Sample call

http://MYDOMAIN/webapi/RegisterUser/?newuser={"username":"aedfefwefwefeaSDXA","password":"qwe123","email":"ronent@top4.com","ip":"192.118.132.1","useragent":"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36","promocode":"mypromocode"}

URL Path

http://MYDOMAIN.com/webapi/RegisterUser/

Parameters

Parameter name

Parameter type

Newuser

JSON object

Parameters structure

newuser

Name

Type

Notes

Username

string

6-25 alphanumeric characters

Password

String

6-15 alphanumeric characters

Email

String

The e-mail address of the user

Ip

String

The ip address of the user

useragent

String

The user agent of the user's browser

affiliateid String The Affiliate Sponsor ID
sendemail Int 0/1 – send to the user welcome e-mail with his login details
promocode String The Affiliate promocode

culture

Int

1 English

2 Italian

3 French

4 German

5 Spanish

6 Portuguese

13 Hindi

15 Dutch

18 Russian

21 Swedish

25 Arabic

Set the default culture of the user.

The default culture is English.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>user-id</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

  1. 201 - Invalid time stamp
  2. 202 - user already exist
  3. 203 - Mandatory field is missing
  4. 204 - Invalid e-mail address
  5. 205 - Invalid IP address
  6. 206 - Invalid username
  7. 207 - Invalid password
  8. 208 - Internal error
  9. 209 - Invalid culture ID


RegisterSegPayUser

Description

Registers a new user in the system without adding billing information.

Sample call

http://MYDOMAIN/webapi/RegisterUser/?newuser={"username":"aedfefwefwefeaSDXA","password":"qwe123","email":"ronent@top4.com","segpaytranid":"123456789","ip":"192.118.132.1","useragent":"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36","promocode":"mypromocode"}

URL Path

http://MYDOMAIN.com/webapi/RegisterUser/

Parameters

Parameter name

Parameter type

Newuser

JSON object

Parameters structure

newuser

Name

Type

Notes

Username

string

6-25 alphanumeric characters

Password

String

6-15 alphanumeric characters

Email

String

The e-mail address of the user

segpaytranid String The user last transaction ID with SegPay

Ip

String

The ip address of the user

useragent

String

The user agent of the user's browser

culture

Int

1 English

2 Italian

3 French

4 German

5 Spanish

6 Portuguese

13 Hindi

15 Dutch

18 Russian

21 Swedish

25 Arabic

Set the default culture of the user.

The default culture is English.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>user-id</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

  1. 201 - Invalid time stamp
  2. 202 - user already exist
  3. 203 - Mandatory field is missing
  4. 204 - Invalid e-mail address
  5. 205 - Invalid IP address
  6. 206 - Invalid username
  7. 207 - Invalid password
  8. 208 - Internal error
  9. 209 - Invalid culture ID



RegisterEpochUser

Description

Creates a new user account with Epoch billing information, so 1-click purchases are enabled for the user.

Sample call

http://MYDOMAIN.com/webapi/RegisterEpochUser?data={cocode:"xxx",picode:"caiuoi63p12345",memberid:"1234567890", username:"sampleusername",password:"qwe123",email:" john.smith@mail.com",ip:"10.10.10.10",useragent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36",sendemail:"1",timestamp:"177662662"}

URL Path

http://MYDOMAIN.com/webapi/RegisterEpohcUser/

Parameters

Parameter name

Parameter type

data

JSON object

Parameters structure

Name

Type

Notes

cocode

string

Your Epoch company code

picode

string

The original product code purchased by the user

memberid

string

The original member id of the user you are trying to cross sale to.

email

string

valid e-mail address of the user

username

String

The username of the user. (4-25 characters)

Password

String

The password of the user. (4-25 characters)

useragent

String

The user agent of the user's browser.

ip

string

The IP address of the user.

sendemail


Int

0/1 – send to the user welcome e-mail with his login details.

timestamp


Long

Obtain the current Unix timestamp (seconds since midnight, January 1 st , 1970) in UTC

cultureid

Int

1 English

2 Italian

3 French

4 German

5 Spanish

6 Portuguese

13 Hindi

15 Dutch

18 Russian

21 Swedish

25 Arabic


Set the default culture of the user.

The default value is English.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>5266000</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

  1. 301 - Invalid time stamp
  2. 302 - user already exist
  3. 303 - Mandatory field is missing
  4. 304 - Invalid e-mail address
  5. 305 - Invalid IP address
  6. 306 - Invalid username
  7. 307 - Invalid password
  8. 308 - Internal error
  9. 309 - Invalid culture ID



RegisterCCBillUser

Description

Creates a new user account with CCBill billing information, so 1-click purchases are enabled for the user.

Sample call

http://MYDOMAIN.com/webapi/RegisterCCBillUser?data={tokeninfo:" 5OHSURGICKW5KUPUBOHPZJMGUG32GVRFY45ESQ7WXSNIRQNMIKREWPYGHNCG6ZHBU25D24RPBNLKYBRAZXY2SU2VGC3ELXDUW4GDK6Q=", username:"sampleusername",password:"qwe123",email:"john.smith@mail.com",ip:"10.10.10.10",useragent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36",sendemail:"1",timestamp:"177662662"}

URL Path

http://MYDOMAIN.com/webapi/RegisterCCBillUser/

Parameters

Parameter name

Parameter type

data

JSON object

Parameters structure

data

Name

Type

Notes

tokeninfo

string

CCBill cross sell token info (usegenerateSessionForCrossSale)

cascade_id

string

CCBill cascade id

email

string

valid e-mail address of the user

username

String

The username of the user. (4-25 characters)

Password

String

The password of the user. (4-25 characters)

useragent

String

The user agent of the user's browser.

ip

string

The IP address of the user.

sendemail


Int

0/1 – send to the user welcome e-mail with his login details.

timestamp


Long

Obtain the current Unix timestamp (seconds since midnight, January 1 st , 1970) in UTC

cultureid

Int

1 English

2 Italian

3 French

4 German

5 Spanish

6 Portuguese

13 Hindi

15 Dutch

18 Russian

21 Swedish

25 Arabic

Set the default culture of the user

The default value is English.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>5266000</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

  1. 401 - Invalid time stamp
  2. 402 - user already exist
  3. 403 - Mandatory field is missing
  4. 404 - Invalid e-mail address
  5. 405 - Invalid IP address
  6. 406 - Invalid username
  7. 407 - Invalid password
  8. 408 - Internal error
  9. 409 - Invalid culture ID


RegisterNetBillingUser

Description

Creates a new user account with OCCCash billing information, so 1-click purchases are enabled for the user.

Sample call

http://MYDOMAIN.com/webapi/User/RegisterNetbilingUser?data=Rqd46CwGaGE8s2UYtOa0KOqMM4TbDFow5kanLWFOFA1wbDKgfvrJ0Hty8Go5G%2bVurpdzeMnR9lIortIFSJgpdksLFqkLISzSVHxWhI77i9NwHLAcD8eqAVPcSWdKnyaNHQFexH2QRekGCB6AgxBvjc9xyvML2dA6UNRgziWIaqaKtzPvZKgw3qiZcpnHPPI3a7dl3113i8mHfkCDT47ZX8ht9bCJGNpa%2b3lwA2D4yUUrk3D63dYSg

URL Path

http://MYDOMAIN.com/webapi/User/RegisterNetbilingUser

Parameters

Parameter name

Parameter type

data

encrypted JSON object (see “Parameters Encryption & Encoding”)

Parameters structure

data

Name

Type

Notes

accountId

string

The account id of the user in NetBilling

transactionid

string

The ID of the last transaction of the user, to be used for the 1click purchase.

sitetag

string

The site tag of the user in NetBiling

email

string

valid e-mail address of the user

username

String

The username of the user. (4-25 characters)

password

String

The password of the user. (4-25 characters)

useragent

String

The user agent of the user's browser.

ip

string

The IP address of the user.

timestamp

Long

Obtain the current Unix timestamp (seconds since midnight, January 1 st , 1970) in UTC

Example:

{

 "username": "a33256b",
 "password": "d8a649f",
 "email": "john.smith@mail.com",
 "timestamp": "1405005375",
 "accountId": "112167236985",
 "transactionid": "195406467",
 "sitetag": "LiveCam",
 "ip": "192.118.133.1",
 "useragent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"

}

Prepare the request data parameter

The JSON object should be built from the data parameters described above and then processed as described in “Parameters Encryption & Encoding”.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>5266000</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

  1. 401 - Invalid time stamp
  2. 402 - user already exist
  3. 403 - Mandatory field is missing
  4. 404 - Invalid e-mail address
  5. 405 - Invalid IP address
  6. 406 - Invalid username
  7. 407 - Invalid password
  8. 408 - Internal error

RegisterRocketGateUser

Description

Creates a new user account with Rocketgate billing information, so 1-click purchases are enabled for the user.

Sample call

http://MYDOMAIN.com/webapi/RegisterRocketgateUser?data={referring_merchant_id:"xxx",referred_customer_id:"yyy",card_hash:"zzz",username:"sampleusername",password:"qwe123",email:"john.smith@mail.com",ip:"10.10.10.10",useragent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko)Chrome/31.0.1650.57 Safari/537.36",sendemail:"1",timestamp:"177662662"}

URL Path

http://MYDOMAIN.com/webapi/RegisterRocketgateUser/

Parameters

'Parameter name'

'Parameter type'

data

encrypted JSON object (see “Parameters Encryption & Encoding”)

Parameters structure data

Name Type Notes
referring_merchant_id string Your Rocketgate merchant ID
referred_customer_id string Your Rocketgate customer ID
card_hash string Your Rocketgate cardHash
email string valid e-mail address of the user
username string The username of the user. (4-25 characters)
password string The password of the user. (4-25 characters)
useragent string The user agent of the user's browser.
ip string The IP address of the user.
sendemail int 0/1 – send to the user welcome e-mail with his login details.
timestamp long Obtain the current Unix timestamp (seconds since midnight, January 1 st , 1970) in UTC
cultureid int Set the default culture of the user.
1 English
2 Italian
3 French
4 German
5 Spanish
6 Portuguese
13 Hindi
15 Dutch
18 Russian
21 Swedish
25 Arabic
The default value is English.

Return value

The new user id.

Success response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>5266000</Message>

<Status>true</Status>

</WebApiResponse>

Failed response

<WebApiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">

<Message>401-Username already exist</Message>

<Status>false</Status>

</WebApiResponse>

Error Messages

1.  301 - Invalid time stamp

2.  302 - user already exist

3.  303 - Mandatory field is missing

4.  304 - Invalid e-mail address

5.  305 - Invalid IP address

6.  306 - Invalid username

7.  307 - Invalid password

8.  308 - Internal error

9.  309 - Invalid culture ID