Page MenuHomeDatingVIP

Example
Updated 2,871 Days AgoPublic

Examples

Typical use-case of DatingVIP object is as follows:

$DVIP = new DatingVip('0e1ee13f945b4783633fb8f10c51382304e9d8c74', '1b9641d156d32fe3ec99a8fb38c9f2dd');
$DVIP->setApiUrl('http://data-a4.datingvip.com');
$DVIP->setAuthorizeUrl(rawurldecode('http://www.crossdressingwebcams.com/oauth/authorize'));
$DVIP->setToken('874ee4c8634e5426a4d0c663788b58ce04fe0d946', '983adace64965a9c24649c69f178a4e8');

try {
     $AccountData = $DVIP->get('/account/get_data', array ('id' => '42'));
  } catch (Exception $e) {
  // handle exception here
}

Based on this information, or code - you know that you're trying to communicate with DatingVIP - thus we don't need to send any additional query params - application flow can be handled based on this info.

If you get an exception while working with DatingVIP object - you can handle it and you can change application flow based on that.

Exceptions that are thrown are:

class DatingVipBadRequestException extends DatingVipException{};
class DatingVipNotAuthorizedException extends DatingVipException{};
class DatingVipForbiddenException extends DatingVipException{};
class DatingVipNotFoundException extends DatingVipException{};
class DatingVipNotAcceptableException extends DatingVipException{};
class DatingVipEnhanceYourCalmException extends DatingVipException{};
class DatingVipInternalServerException extends DatingVipException{};
class DatingVipBadGatewayException extends DatingVipException{};
class DatingVipServiceUnavailableException extends DatingVipException{};

All redirects are handled by iframe application itself, either within it's index page or callback page. We're not redirecting to login page - iframe application itself is doing that - we're just supplying login url.

Live Example

OAuth:

$DVIP = new DatingVip('0e1ee13f945b4783633fb8f10c51382304e9d8c74', '1b9641d156d32fe3ec99a8fb38c9f2dd');
$DVIP->setApiUrl('http://data-a4.dvipapp.com');
$DVIP->setAuthorizeUrl(rawurldecode('http://www.crossdressingwebcams.com/oauth/authorize'));
$DVIP->setToken('874ee4c8634e5426a4d0c663788b58ce04fe0d946', '983adace64965a9c24649c69f178a4e8');
$AccountData = $DVIP->get('/account/get_data', array ('id' => 42));

So, important thing is that endpoint is first param (invariable), and all params (variables) should be passed as second argument to method $DVIP->get in form of array. Then you receive response like following one:

DatingVipResponse Object
(
    [debug:DatingVipResponse:private] => 
    [__resp:DatingVipResponse:private] => OAuthClientResponse Object
        (
            [response:OAuthClientResponse:private] => Array
                (
                    [headers] => Array
                        (
                            [X-Powered-By] => PHP/5.4.4
                            [Set-Cookie] => PHPSESSID=rblm0lngsmgkn6i757eajbvja6; path=/; domain=.datingvip.com
                            [Expires] => Thu, 19 Nov 1981 08:52:00 GMT
                            [Cache-Control] => public
                            [Pragma] => public
                            [Content-Language] => en-US
                            [Content-Type] => text/html; charset=UTF-8
                            [Transfer-Encoding] => chunked
                            [Date] => Thu, 16 Aug 2012 09:32:32 GMT
                            [Server] => lighttpd/1.4.30
                        )

                    [data] => {"id":"42","site_id":"0","db_group":"CMMS1","username":"chatcity30","email":"debug+chatcity30@datingvip.com","avatar":"http://cdn.dvipcdn.com/a4/thumbnails0/04/2/42_2.jpg","birthdate":"1984-01-10","age":"28","bday":"0110","country":"RS","state":"","city":"Belgrade","zip":"11000","gender_id":"1","looking_id":"2","gender":"Male","looking":"Female","title":"lookin for fun","access":"30","access_name":"PremiumPlus","access_is_premium":false}
                    [code] => 200
                    [time] => 0.377719
                    [length] => -1
                    [type] => text/html; charset=UTF-8
                    [url] => http://data-a4.datingvip.com/account/get _data?id=42
                )

            [debug:protected] => 
        )

)

I guess this is the same problem with your previous report of such bug.

Get User

GET /account/get_data?id=$user_id

Example request on A1 system

GET /account/get_data?id=14

Example response:

{
  "id": "14",
  "site_id": "94",
  "db_group": "A01",
  "username": "korisnik4",
  "email": "debug@utp-code.com",
  "avatar": "http://cdn.dvipcdn.com/a1/default-male.png",
  "birthdate": "1988-10-26",
  "age": "23",
  "bday": "1026",
  "country": "US",
  "state": "AL",
  "city": "Chrono",
  "zip": "15444",
  "gender_id": "1",
  "looking_id": "2",
  "gender": "Male",
  "looking": "Female",
  "title": "Looking for fun",
  "access": "10",
  "access_name": "Free",
  "access_is_premium": false
}

User must be authenticated via API.

More on OAuth protocol

http://oauth.net/
http://en.wikipedia.org/wiki/OAuth

Last Author
boris
Last Edited
Jun 15 2016, 15:50

Event Timeline

boris moved this document from Unknown Object (Phriction Wiki Document).
boris changed the visibility from "All Users" to "Public (No Login Required)".
boris shifted this object from the Restricted Space space to the S6 Everyone space.Aug 8 2018, 08:10