PseudoRESTAPI uses GitHub OAuth to authenticate its users. First, you need to create a GitHub account before you can sign in the application. Once this is done, you can now proceed with the basic concepts:
Once you log in the application, click the New Project button and complete the form:
Then, click the save button. You will notice that after saving, a notification will appear on the page displaying your project's secret key. Make sure to copy this secret key since this is the only time that you will see it!
Afterwards, click your new project. This will redirect you to the API page.
The next step is to create your resources and API endpoints, but before that, you must first acquire your API key. Click the settings button on the left navigation bar, then copy the API key below your project description:
Unlike the secret key, you can always view your API key in the Settings page.
Now that you've obtained your API key, let's create your database!
Click the resources button on the left navigation bar. This will redirect you to the Resources page where you will design the schema and generate the data for your fake database.
To create your first model, click the New Resource Model button. You will be given many options to design your model but for now, you can follow the guide below:
You will notice that the table on the right side will adjust based on the schema that we designed earlier. We can populate the table by clicking the Manage Data < New button.
Adjust the slider based on the number of data that you want to generate, then click save.
The table should now display your mock data:
We can add more resources later, but for now let's proceed with creating the API endpoint.
The last step for your mock server is to create the API endpoint where you will expose the resources.
Click the APIs button on the left navigation bar. This will redirect you to the API page.
Afterwards, click the New API button and complete the form:
As you can see, you can select the resources that you created earlier in the previous section. Click save once you're satisfied with the details.
We can now finally test your mock server.
You can test your API endpoint using cURL with the following format:
curl -X GET https://gateway.pseudorestapi.com/api/{api-endpoint} -H "Accept: application/json" -u {api-key}:{secret-key}
Note that the gateway application uses the basic scheme to authenticate the user.
Here's an example in postman:
That's it! You've now created your own mock server.