-
Notifications
You must be signed in to change notification settings - Fork 0
Testing the endpoints with Postman
We have attached a postman collection in this repository to showcase how to perform the calls to an AWS App Runner instance that is running this service.
You can get postman from their official website.
With postman, you can then import the circuloos.postmanCollection.json
in this repository.
You will either want to download the file by clicking the download button:
Or you can get a URL directly to the file on GitHub by clicking on the raw
button when viewing the file:
To import the file so, you will want to open postman, then on the top left click on File
then click on Import...
, or alternatively use the Ctrl+O
default key bind to import:
You can then select the file you downloaded, or paste the URL of the raw file on GitHub (example URL: https://raw.githubusercontent.com/alastria/Circuloos/main/circuloos.postmanCollection.json?token=GHSAT0AAAAAACSCHFJ2ITWIEZS2T4O5PXFWZSW65NA
):
Postman will then automatically import the collection, and it will now be usable by you to test:
Before you are able to execute any tests, you will have to get an API Key from us.
If you already have an API Key, then in postman, within the collection itself, you should navigate to the variables tab:
You will see 3 variables:
-
host
- the server postman will send the requests to -
api-key
- The api key we gave you to authenticate to the instance we deployed in AWS App Runner -
erc721structDataAddress
- The address of a deployed AlastriaERC721StructData contract that we will interact with
You will want to paste your API Key directly into the current value of the api-key variable like so:
Dont forget to save the change you just made either with Ctrl+S or by pressing the Save button! Once you have done this, the collection is set up, and you can start running the tests.
There are a total of 5 requests prepared in this postman collection:
- Deploying the contract
- Minting a new token with ID 0 and some data
- Retrieving the data for token ID 0
- Updating the data for token ID 0
- Burning the token with ID 0
Whilst all 5 requests are provided, there are only 2 tests for you to run.
You will be running the POST
request named Mint token with ID 0
.
This should give you a transaction response when running it.
To run it, you will first have to open the request by clicking on it:
Once you have it open, navigate to the Body
tab within the request.
You will be able to see an example as to how you can create the token with a struct value:
Feel free to change the value in between the double quotes ("
) to something else.
Once you are ready, you can run the request by pressing the Send
button:
If all went well, you should be able to see a result on the bottom of your screen.
This result provides you with the transaction receipt from the blockchain after executing the smart contract:
You can see in the image that there is a Status: 200 OK
on the response.
If you have it saying Status: 403 Forbidden
, go back to Setting up the collection and make sure the API key is correct, with no additional spaces or characters, and that you saved the collection.
Example of it saying Status: 403 Forbidden
:
You will be running the POST
request named Burn token with ID 0
.
This should give you a transaction response when running it.
To run it, you will first have to open the request by clicking on it:
Once you have it open, you can run the request by pressing the Send
button:
If all went well, you should be able to see a result on the bottom of your screen.
This result provides you with the transaction receipt from the blockchain after executing the smart contract:
You can see in the image that there is a Status: 200 OK
on the response.
If you have it saying Status: 403 Forbidden
, go back to Setting up the collection and make sure the API key is correct, with no additional spaces or characters, and that you saved the collection.
Example of it saying Status: 403 Forbidden
: