Jump to content
  • 0

API doubt


Hitz

Question

Hello

I started studying understanding how APIs work and I'm having trouble following their reasoning ...

 

Following the API guide, I set the API Enabled field to True. and created an account with user "server" and granted access "api server true".

To start the next step as I'm on localhost using XAMPP, I created a folder in htdocs "api / oauth / token" and a "request.json" file with the following code:  

 

{ 

"grant_type": "password",

"username": "server", 

"password": "5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8",

}

 

On a server that I have hosting sites I put the same folders and the file request.json and with the site did a test and got 200 success: https://reqbin.com/

 

  • The first question came to mind, do I need to create a get token file, refresh token, delete token and so on?
  • When it comes to a user do I need to create their file or folder or how would the server do it automatically?
  • Related to users and commands like get item would you need to manually create this entire directory "/ api / v1 / players / [lookupKey] / items / inventory"?
  • Then I had the doubt how to connect this api with the server once I have the user, just put in the api configuration file on the server the direction and the port where has the API files?

 

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • -1
16 hours ago, SrBlast said:

Hello

I started studying understanding how APIs work and I'm having trouble following their reasoning ...

 

Following the API guide, I set the API Enabled field to True. and created an account with user "server" and granted access "api server true".

To start the next step as I'm on localhost using XAMPP, I created a folder in htdocs "api / oauth / token" and a "request.json" file with the following code:  

 


{ 

"grant_type": "password",

"username": "server", 

"password": "5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8",

}

 

On a server that I have hosting sites I put the same folders and the file request.json and with the site did a test and got 200 success: https://reqbin.com/

 

  • The first question came to mind, do I need to create a get token file, refresh token, delete token and so on?
  • When it comes to a user do I need to create their file or folder or how would the server do it automatically?
  • Related to users and commands like get item would you need to manually create this entire directory "/ api / v1 / players / [lookupKey] / items / inventory"?
  • Then I had the doubt how to connect this api with the server once I have the user, just put in the api configuration file on the server the direction and the port where has the API files?

 

Thanks

 

6de79f3f1cc090fe51ece6d4682ad450.jpg

 

Spend 5 minutes here it will be worth all the way: https://docs.freemmorpgmaker.com/

Link to comment
Share on other sites

  • -1
2 hours ago, SrBlast said:

What if i told you that I spend more than 5 minutes before you answer, and my doubts came because i tried to figure out how work with APIs... 

But thats ok

Thanks for your sweet atention... 

 

What if i told you that the documentation is enough knowledge if you cant perform what it says then you are yet not ready ?

Documentation is quite clear if you do not know how to use it that's something else,from what i can see you are asking how to use the api but that's same as if asking someone to write the code for you which wont happen...

P.s: Learn some web dev basics before getting into api.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...