How to Authenticate Using X-API-KEY with the SWEP Calculation API

To securely access the SWEP Calculation API, you need to authenticate each request using your unique API key.
This key is provided to you during the registration process and must be included in the header of your API requests.
Below is a step-by-step guide on how to use the X-API-KEY header for authentication.

REST API

You can find the complete REST API documentation, including available endpoints, request parameters, and response formats, at the following link

Scalar playground http://api.swep.net/scalar/v1

Swagger playground http://api.swep.net/swagger/index.html

Redoc http://api.swep.net/redoc/index.html

POST /calculateSinglePhase HTTP/1.1
Host: api.swep.net
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Content-Length: 1402

{
  "inputs": {
    "calculationMethod": "Design",
    "selectedFluidSide1": {
      "fluidId": 53,
      "isGas": false,
      "inputValue": null
    },
    ...
}

Below are sample scripts for accessing the REST API in various programming languages, tailored to your preferred development environment:

GraphQL

Our GraphQL API provides a flexible and efficient way to query and manipulate data. You can explore and test our GraphQL API using the GraphQL UI available at the following link:

GraphQL playground http://api.swep.net/graphql/ui

POST /graphql HTTP/1.1
Host: api.swep.net
x-api-key: YOUR_API_KEY
Content-Type: application/json
Content-Length: 2082

{
  "query": "query Calculate() {
        calculateSinglePhase(request: {
            inputs: {
                calculationMethod: DESIGN,
                selectedFluidSide1: {
                    fluidId: 53,
                    isGas: false,
                    inputValue: null
                },
        ...    
    }"
}

Below are sample scripts for accessing the REST API in various programming languages, tailored to your preferred development environment:

Sample GraphQL queries for different operations

Support

If you have any questions or need further assistance, please get in touch with our support team at ssp@swep.net.

 

An unhandled error has occurred. Reload 🗙