Jump to content

tortadelabarda

Contributors
  • Posts

    8
  • Joined

  • Last visited

Everything posted by tortadelabarda

  1. I am trying to access the API but this error returns, what can I do to solve it? ERR_SSL_VERSION_OR_CIPHER_MISMATCH
  2. Yes, you can make it via API through web or any other application.
  3. Great, now I just have to learn how to compile the project
  4. I have seen that the project has not received updates for a few months, will there be no support or they just took a break?
  5. Hello starlord, here is an example code so you can communicate with the API. I used this calls to create a offline market system. It is very easy to understand, you will not have problems. Happy coding! //GET TOKEN $url = 'http://localhost:5400/api/oauth/token'; $password = '12345'; $password = hash( 'sha256', $password ); $data = array( 'grant_type' => 'password', 'username' => 'test', 'password' => $password ); $data = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $result = json_decode($result, JSON_OBJECT_AS_ARRAY); //GET INVENTORY $player = 'dummy'; $url = 'http://localhost:5400/api/v1/players/'.$player.'/items/inventory'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('authorization: bearer '.$result['access_token'].'')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $inventory = curl_exec($ch); curl_close($ch); $inventory = json_decode($inventory, JSON_OBJECT_AS_ARRAY);
×
×
  • Create New...