Request structure
Your URL address for webservice constructs as below
https://[ clients system address ]/affiliate/
Every request has system parameters as below. All the parameters are lowercase and case-sensitive. Http client has to use the POST protocol.
Request parameters
| affuid | Username |
| affp | Password |
| affrequest | OneSystem command to be executed |
| afflan (optional) | Language information. The Clients default language unless provided. |
| affsessionid (optional) | SessionID for the connection |
You may send username and password with all requests or you may use “userdata” request to get current user information and SessionID. After you retrieve SessionID you may send it with each request with affsessionid parameter without username and password for better performance and security.
Sample PHP Curl Request ClassTo make more brief and understandable documentation we wrote a sample PHP curl class script which we will use in further command descriptions.
Please download and examine it before you continue from the link below.
Download Sample-Curl-Class.zip
PS: Please be notified that Username using api services has to have IP restriction for security purposes.
PHP Code example:
$request = new HttpRequest();
$request->url=”http://funtrip.onesystem.online/affiliate/”;
$request->addparam(“affuid”,[your username]);
$request->addparam(“affp”,[your password]);
$request->addparam(“affrequest”,”userdata”);
try {
$request->execute();
if ($request->status) {
$JSONData=json_decode($request->response);
if ($JSONData) {
$sessionid = $JSONData->sessionid;
# USE $sessionid IN FUTHER REQUESTS FOR BETTER PERFORMANCE
# USE JSON DATA AS YOU NEED
# BE AWARE THAT IN MOST CASES JSON DATA CAN BE
# ARRAY OF OBJECTS AS RESULTSET.
} else throw new Exception(“Returned data is nat a valid JSON source”);
} else throw new Exception($request->errorcode.” – “.$request->response);
} catch (Exception $e) { echo ‘Error: ‘, $e->getMessage(), “\n”; }
