Giter VIP home page Giter VIP logo

ubisoftapi-php's Introduction

Ubisoft-Uplay-API-PHP

  • API based on https requests to Ubisoft servers. It's just proof of concept.

  • If you will login too often, google captcha will be forced. There's no support of it

  • Last Update: 1st Mar 2017

  • Use this only as reference, this code is not well designed and outdated (it'll probably work)!

Downloading

To use this API you'll just need to copy ticket_file and uAPI.php

Examples

First of all, you'll need to include api

<?php
include("uAPI.php");
?>

Login and update Ticket in ticket_file

<?php
include("uAPI.php");
$uapi = new ubiapi("email","password",null);
$apianswer=$uapi->login(1); //1 for raw, 2 for decoded raw
print $apianswer["error"]; //when 0 - everything is good!
?>

Update Ticket (no need to login everytime, without this function you can get banned)

<?php
...
//include api and define it as $uapi
$rt = $uapi->refreshTicket("bynick","v.m.r_ipa");
if($rt["error"]){
	die( "Error: ".$rt["content"]);
}
else{
	print "No Error: ".$rt["content"];
}

Get friendlist

<?php
...
//include api, define it as $uapi and update ticket
$fl = $uapi->getFriends();
if($fl["error"] != true){ //small check if api response is vaild
	print $fl["raw"];
}

Get Nickname using profileId

<?php
...
//include api, define it as $uapi (and update ticket [refreshTicket])
$su = $uapi->searchUser("byid","01e84770-c50e-402b-8132-b94016f93b77");
if($su["error"] != true){
	print "profileid is: ".$su["nick"]; //you can use 'json' to get array with all info
}

Get profileId using Nickname

<?php
...
//include api, define it as $uapi (and update ticket [refreshTicket])
$su = $uapi->searchUser("bynick","v.m.r_ipa");
if($su["error"] != true){
	print "profileid is: ".$su["uid"]; //you can use 'json' to get array with all info
}

Disabling Debug Messages

To disable debug messages you'll need to change line 14 in uAPI.php

from

public $debug=true;

to

public $debug=false;

License

This project is licensed under the MIT License - see the LICENSE.md file for details

ubisoftapi-php's People

Contributors

k4czp3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ubisoftapi-php's Issues

unable to log in

the output is

`03:09:40 - [__construct ] - Using creds to login

03:09:40 - [generateB64Creds ] - B64: uncomment line below to see this

03:09:40 - [generateB64Creds ] - B64: <snap!>
03:09:40 - [login ] - Going to login...
03:09:40 - [login ] -
url:https://connect.ubi.com/ubiservices/v2/profiles/sessions
appid:314d4fef-e568-454a-ae06-43e3bece12a6
authbasic:Y2hyaXN0b3BoZXJqYW1lc21vbnRnb21lcnlAZ21haWwuY29tOlBhc3N3b3JkMQ==
03:09:40 - [login ] - Executed request (to see it, uncomment log line)
03:09:40 - [login ] - After making use of g-zipdecode, string is empty, using orginal one...
03:09:40 - [login ] - Your authstring (to see it, uncomment next line of code)
03:09:40 - [login ] - Welcome,
03:09:40 - [login ] - Your UserId is
03:09:40 - [login ] - You can ignore last function for saving authstring but you'll need to edit some lines of codes to disable it
03:09:40 - [uplayticket ] - Returning Ticket
03:09:40 - [uplayticket ] - Saving ticket
03:09:40 - [uplayticket ] - Returning Ticket`

I can not get this to work. please take a look at my code and let me know what i am doing wrong.

index.php.txt
uAPI.php.txt

please let me know if you

please let me know how to fix this.

how do i make the captcha?

Once I was blocked from accessing how do I do the chapcha?

[0] => {"message":"The Ubi-Challenge header is required."
[1] => "errorCode":1301
[2] => "httpCode":409
[3] => "errorContext":"Profiles Client Legacy"
[4] => "moreInfo":""
[5] => "transactionTime":"2017-10-15T19:40:09.1155351Z"

Adding more information about the game currenty played

So currently the API only supports info about what someone is playing atm. Not more detailed info about the game (you can see this info in the uplay client if you go to the friendlist E.G. Rainbow six supports that). It would be great to find the backend where ubisoft is gathering this info from.

Few questions

Hey, I'm terrible at PHP

is it possible you could rewrite/provide me request needed to grab friendslist? All i need is to see who is online who is not.

my target language is python but a standard request with headers and stuff is all i need

Thanks !

No login

Is this still working for you? If I try to login, I dont get any response from login web call.

Not working..

Nice scripts, but:

PHP message: PHP Notice: Undefined index: username in /var/www/uAPI.php on line 165
PHP message: PHP Notice: Undefined index: userId in /var/www/uAPI.php on line 166
PHP message: PHP Notice: Undefined index: ticket in /var/www/uAPI.php on line 168
PHP message: PHP Notice: Undefined variable: uapi in /var/www/test.php on line 7
PHP message: PHP Fatal error: Uncaught Error: Call to a member function searchUser() on null in /var/www/test.php:7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.