1.2. Register

Request for authorization to use the API System. This is immediately used after calling the Login Method. This method has to be called within 60 seconds, otherwise the user who was just authenticated will not be authorized. It is important to send the request to the URL provided by the login method. This URL is the URL where subsequent requests will be made.

To ensure that you are the one that is authorized or authenticated, when the token is passed as part of any request, your IP Address will also be used as part of the authorization process. In the event that you change your IP Address while you are logged in to the system, you will be immediately de-authorized and you need to regain access by Logging in again.

Inactivity timeout is 5 minutes. This means that the user will get disconnected if there is no activity for 5 minutes.

In order to maintain activity and not be disconnected or be timed-out, if you are not doing anything, you need to do a IsLoggedIn call 4 or less minutes apart (but not less than a minute), to prevent the session from closing. Not to worry as if you are doing a method call other than the IsLoggedIn, this also resets the timer to another 5 minutes.

Request

Method

URL

Method

URL

GET

/AsianOddsService/Register?username={username}

Type

Params

Values

Type

Params

Values

HEADER

AOKey

string

HEADER

AOToken

string

HEADER

accept

string

QUERY STRING

username

string

 

Request Values

Value

What is this for

Value

What is this for

username

is the username used to login to the system

AOKey

Key generated by the Login method. This is used to authorize the user to use the API System

AOToken

Token generated also by the Login method. This token identifies which user is requesting or executing the API Method. This has to be sent for all of the request except during execution of the Login method

accept

application/json.

 

Response Values

Value

What is this for

Value

What is this for

Code

Holds the status of the response. If it is 0, then it is successful. Negative, values indicate failure

Result

Returns a boolean if the authorization is successful or not

TextMessage

Message returned by the server. This is important and you must always check this from time to time as immediate messages related to the system are reported here.

 

Sample JSON Response

Response Type

Response

Response Type

Response

Success

{
"Code": 0,
"Result": {
"Success": true,
"TextMessage": "Successfully Registered."
}
}

Fail

{
"Code": -1,
"Result": {
"Success": false,
"TextMessage": "Please register to the Service URL provided when you logged in."
}
}