Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

API Caller via Postman

https://docs.google.com/document/d/1vkDek8aHX1vfu0oDOzNltW47YQl7LXmi1Rb-Vh61rOc/edit?usp=sharing

...

  1. Go to Postman and enter the following header :

            POST: http://mock-api-caller.openlegacy.com/iam/auth/token

...

  1. Go to Postmen and enter the following header:
    GET: http:/mock-api-caller.openlegacy.com//iam/.well-known/jwks.json

  2. Send.

  3. Now the JWKS are in the response body.

    Code Block
    {
        "keys": [
            {
                "alg": "RS256",
                "kty": "RSA",
                "use": "sig",
                "n": "****",
                "e": "****",
                "kid": "****",
                "x5c": [
                    "****"
                ],
                "x5t": "****"        }
        ]
    }

...

  1. Insert the following URL: 

            POST: http://mock-api-caller.openlegacy.com/iam/api/v1/user/create

...

  1. Insert the following URL: 

           DELETE: http://mock-api-caller.openlegacy.com/iam/api/v1/user/delete 

...

  1. Insert the following URL:  

            GET: http://mock-api-caller.openlegacy.com/api/v1/endpoints

...

  1. Insert the following URL:

           POST: http://mock-api-caller.openlegacy.com/api/v1/specification/openapi/convert 

...

  1. Insert the following URL:

              POST: http://mock-api-caller.openlegacy.com/api/v1/specification/openapi/parse

...

Info

Behind the scenes: the endpoint -POST: /api/v1/blunk/create invoked and created the endpoints and stored them in the DB. You successfully created new endpoints.  

...

  1. Insert the following URL:

           DELETE: http://mock-api-caller.openlegacy.com/api/v1/endpoints/bulk/delete

...

You successfully deleted endpoints. 


Import - Endpoint

When importing a Swagger specification to API Caller, each endpoint in the specification will also hold a reference to a the specification it was derived from.

  • The Specification name will be derived from the Swagger Info-->title property

  • Each spec will have a unique identifier (UUID) - specId

    • If no info.title is specified in the Swagger file:

      • A default name will be generated: Specification_xxxxxxx

      • With the last 7 digits of the Specification ID (uuid)
        example: Specification_1ab23tt

  • Each endpoint will hold a reference to its specification

  • If an endpoint already exists with the same specId (UUID), the existing endpoint will be updated (including the specification name) and its Status will be maintained

  1. Insert the following URL:

...

You successfully imported an endpoint.

Export - endpoint 

All endpoints that were derived from the same swagger specification can be exported in a single call by specifying the Spec ID in the API call. the resulting JSON file will contain all relevant endpoints and their related specification.

When exporting multiple endpoints to a single JSON file, the base-url in the exported endpoints can be changed. This eases the exporting of multiple endpoints in one environment and then importing them into another.

The API receives a set of endpoints IDs and returns the corresponding endpoints when using the export option on one or more endpoints, inside its logic it invokes the POST:  /get bulk endpoints. 

  1. Insert the following URL:

              POST: http://mock-api-caller.openlegacy.com/api/v1/endpoints/export

...

Now you received a JSON with endpoints’ specifications. 

When exporting endpoints using the API:

  • Add base-url string to API call to replace the exported endpoints base-url property :

    • When added (even with empty string value) , it replaces the original base-url for each of the specified endpoints to the new base-url specified in the API

      • Validation: Only characters that are allowed in URLs are allowed

    • When not added to the API call , doesn’t change the original base-url in any of the specified endpoints.

    • When the base-url is specified with an HTTP schema prefix (such as: http:// … ):

      • Change the HTTP schema property to match the new URL’s

      • Change the base URL as required.

Publish - endpoint

Receives one endpoint’s ID or a set of endpoint IDs and updates the status of the corresponding endpoints to PUBLISH.

  1. Insert the following URL:

PUT: http://mock-api-caller.openlegacy.com/api/v1/endpoints/bulk/publish

...

  1. Insert the following URL:

PUT: http://mock-api-caller.openlegacy.com/api/v1/endpoints/bulk/unpublish

...

  1. Insert the following URL:
    PUT: http://mock-api-caller.openlegacy.com/api/v1/endpoints/:id

  2. Use the /get endpoint to get the swagger specification of the endpoint that you want to update.

  3. Go to Params and define the ID as a path variable. 

  4. Go to headers and define Accept as application/json.

  5. Copy the endpoint’s definition scope into the request body. 

...