Skip to content

Commit

Permalink
updated swagger page (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
lufa23 authored Jul 28, 2023
1 parent c30790b commit e15f91f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions content/2.developers/2.developer-tools/5.swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ The Swagger specification serves as the contract for the API. It includes detail

Each endpoint uses the HTTP GET method. Every operation returns either a successful HTTP 200 response with a defined schema or a default error response.

You can find the <a href="https://api.constantine.archway.tech/swagger/" target="_blank" >Archway swagger here</a>.
Swagger is provided for both <a href="https://api.mainnet.archway.io/swagger/" target="_blank" >mainnet</a> and <a href="https://api.constantine.archway.tech/swagger/" target="_blank" >testnet</a>.




## How to use the swagger?

To use this Swagger API documentation, you must first set up the necessary API calls from a tool or platform that supports RESTful HTTP requests. Here are the general steps you would follow:

1) Identify the API Endpoint: First, select the API endpoint you want to interact with. For instance, if you want to get the latest block's details for Constantine testnet, the endpoint would be **https://api.constantine.archway.tech/blocks/latest**.
1) Identify the API Endpoint: First, select the API endpoint you want to interact with. For instance, if you want to get the latest block's details for Archway mainnet, the endpoint would be **https://api.mainnet.archway.io/blocks/latest**.

2) Choose the HTTP Method: For all the endpoints in this specification, the HTTP method is GET.

3) Construct the API URL: This involves appending the API endpoint to the base URL of the API.

4) Include Query Parameters (if needed): Some endpoints require additional parameters that should be included in the request. For instance, the **/validatorsets** endpoint accepts a block height as a parameter: **https://api.constantine.archway.tech/validatorsets/18000**.
4) Include Query Parameters (if needed): Some endpoints require additional parameters that should be included in the request. For instance, the **/validatorsets** endpoint accepts a block height as a parameter: **https://api.mainnet.archway.io/validatorsets/18000**.

5) Send the Request: Use a tool, library, or software that can send HTTP requests. This could be a command-line tool like curl, a programming language with libraries for sending HTTP requests, or a complete API platform like Postman or Insomnia.

Expand All @@ -42,7 +45,7 @@ An example on how to query the information regarding the latest block, would be

```bash
curl -X 'GET' \
'https://api.constantine.archway.tech/blocks/latest' \
'https://api.mainnet.archway.io/blocks/latest' \
-H 'accept: application/json'
```

Expand Down

0 comments on commit e15f91f

Please sign in to comment.