1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BO2 RTE REST API

Discussion in 'Web Development' started by thahitcrew, Apr 26, 2016.

Tags:
  1. thahitcrew

    thahitcrew Modder

    224
    262
    163
    Credits:
    277
    (PS3 Only)
    (Thread moved to Web Development section on 5/21/2016)
    Hey guys whatsup, recently i finished a small beta version of my new BO2 RTE REST API
    (Black Ops 2 Real Time Editing REpresentational State Transfer Application Program Interface - or simply: BO2 RTE REST API).

    (NOTE: For the API to work you MUST have my BO2_RTE_API_Response_Listener listener running. For the "changeName", "changePrestige" and "rebootFlagType" parameters to work you MUST be connected to your console. ALSO make sure you have black ops 2 running on your PS3 before attempting to connect to your console via my API)

    The API can be used to make simple web based RTE tools on your websites with ease. Here is an example of how to connect/attach to your console using my API in PHP:
    PHP:
    <?php

    if(isset($_POST['SubmitConsoleIP']))//Check if Console IP Has Been Submitted
    {
        
    $ConnectToConsole file_get_contents("http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?consoleIP=CONSOLE_IP_HERE");//Query API with console IP (this is used for the connection process)
    }

    ?>
    After the above query has been executed you can check if the connection to your console was completed with success by simply calling my API with the parameter "returnConnectionStatus" equal to "1"
    PHP:
    http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?returnConnectionStatus=1
    The above will return a JSON array like so:
    PHP:
    {"Connection_Status":"1"}
    If "Connection_Status" is equal to "1" that means you're currently connected to your console, if "Connection_Status" is equal to "0" OR "0.5" this means you are not connected to your console.

    Here is an example of how to check if connection to your console was done with success:
    PHP:
    <?php

       $PublicIP 
    "ENTER_YOUR_PUBLIC_IP"//Enter your PUBLIC ip here, this is used to check DB for console connection status
       
    $GetConnectionStatus file_get_contents("http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?returnConnectionStatus=1&IPForCheckConnectionStatus=".$PublicIP); //Returns either "1", "0" or "0.5"
       
    $JSONResponse $GetConnectionStatus;
       
    $DecodeJSONArray json_decode($JSONResponse,true);
       
    $ConnectionStatus $DecodeJSONArray['Connection_Status'];
       if(
    $ConnectionStatus == "0" || $ConnectionStatus == "0.5")
       {
           echo 
    "Not Connected";//You're NOT connected to your console
       
    }
       else
       {
           echo 
    "Connected";//You ARE connected to your console
       
    }
        
    ?>
    Once you've determined you're connected to your console via my API you can add these parameters to the API: "changeName", "changePrestige" or "rebootFlagType"
    the "changeName" parameter is used to change your name, it can be executed like so:
    PHP:
    http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?changeName=^2Enter_Name_Here
    The "changePrestige" parameter is used to change your prestige, it can be executed like this:
    PHP:
    http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?changePrestige=Enter_Prestige_Here
    The final parameter "rebootFlagType" is used to either ShutDown, HardReboot or SoftReboot your console, here is a list of what each value for the "rebootFlagType" parameter will do:
    PHP:
    ShutDown
    HardReboot
    SoftReboot
    Here is an example query of how to HardReboot your console:
    PHP:
    http://ps3cfw.com/api/ps3/ccapi/bo2/RTE.php?rebootFlagType=2

    If when attempting to query my API you receive a JSON response that looks somewhat similar to this:
    PHP:
    {"Response":"0x03"}
    that means an error has occurred, here is a list of all errors:
    PHP:
    0x01 Already Connected To Your Console
    0x02 
    Invalid Console IP
    0x03 
    Unable To Exectue Query Due To Not Being Connected to Console
    0x04 
    Invalid Reboot Flag Type

    Download BO2_RTE_API_Response_Listener:
    Please login or register to view links or downloads!

    Virus Scan of BO2_RTE_API_Response_Listener:
    Please login or register to view links or downloads!

    Virus Scan results: (4 / 54) Due to MSIL Obfuscation And/Or string encryption
     
    Last edited: Aug 29, 2016
  2. CabCon

    CabCon Head Administrator Staff Member Head Staff Team

    3,884
    2,534
    393
    Credits:
    143,557
    Really nice :smile: Thanks a lot.
     
    Tusta, Gentle and thahitcrew like this.

Share This Page