Explore Your API 🗺️

Explore Your API 🗺️

Find out how to view available endpoints, operations, query parameters and request schemas. Learn how to manage objects using your REST APIs with SwaggerUI!

Access your API

On the Dashboard, find the project you have just created, and click on Show API Key to reveal your project's main API-Key. That key grants full access to your project's REST API so protect it accordingly. Copy the key to your clipboard and click Open Swagger UI.

A new tab will open SwaggerUI, a convenient tool to view your deployed REST API and create requests.

To start making requests, you first have to provide your project's API-Key. In SwaggerUI click Authorize and paste the copied API-Key in the Value field of the popup. Click Authorize and Close to return.

Create an object

Expand the green panel for the POST /notes operation. Click Try it out to configure your first request to your project's REST API. You will see a text field with an example payload. Replace the payload with the following one:

{% c-block language="json" %}
{
  "text": "hello, world!",
  "author": "me"
}
{% c-block-end %}

Click Execute to send the request. Below, the returned payload will show the full object that has just been created.

Note that the id field has been filled automatically. When no custom id is specified, new objects will be assigned a unique alphanumeric id. Copy the id of the object that you have just created.

Read and list objects

Stackprint generates two endpoints to list and read specific objects respectively. Expand the blue panel for the GET /notes/{id} operation. Click Try it out and paste the object id you previously copied in the input field with the label id.

Click Execute to find that the endpoint returns the previously created Note object.

To list object, expand the blue panel for the operation GET /notes. You will see a couple of query parameters for this operation. These parameters can be used to sort, filter and paginate the list of returned Notes.

Try creating a few more Note objects and try out this endpoint with different query parameters to get a feeling for how they can be used to return multiple objects in a way that suits your application.

Update and delete objects

The operation PUT /notes/{id} can be used to update previously created Note objects. Perform a request using the id of the previously created Note. Provide the following payload to update the Note's text, the endpoint will return the updated object:

{% c-block language="json" %}
{
  "text": "bye, world!",
  "author": "me"
}
{% c-block-end %}


To delete a Note, simply invoke the DELETE /notes/{id} operation. Try it with the id of the initially created Note.

Next, try to read that Note again withthe GET /notes/{id} operation and you will find that the respective endpoint responds with HTTP status code 404 and the message Not found indicating that the object no longer exists.