Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »



In This Document 



Have a suggestion for the Armor Knowledge Base? Send a message to kb@armor.com.




Overview

Swagger is a cloud-based tool used to build, deploy, and document APIs. You can use Swagger to test and review the Armor API before you implement the calls. 

Swagger is divided into five sections: 

  • Authentication
  • Infrastructure
  • Network Services
  • Security
  • Support
  • Account Management

Access the Armor API in Swagger

To access the Swagger tool, you must retrieve login credentials. 

  1. Enter the login information for the Armor Management Portal (AMP). Review the following example.   

    POST /auth/authorize
     
    {
      "username": "user@domain.com",
      "password": "password123%^&"
    }
  2. If the authentication is successful, you will receive the authorization code (code). Review the following example. 

    {
     "redirect_uri": null,
     "code": "<<base64-hash>>"
     "success": true
    }
  3. Redeem the authorization code (code) to retrieve the access token and ID token. Review the following example.   

    POST /auth/token
     
    {
      "code":"<<base64-hash>>"
      "grant_type":"authorization_code"
    }
  4. If the request is successful, you will receive the access token (access_token) and the X-Account-Context (id_token). Copy this information. Review the following example. 

    {
     "access_token": "<<32-bit-uuid>>",
     "id_token": "<<base64-hash>>",
     "expires_in": 1800,
     "token_type": "Bearer"
    }
  5. Go to apidoc.tde.armorlabs.co.
  6. In Authorization, enter the access token (access_token). 
  7. In X-Account-Context, enter the id_token.
  8. Click Authorize. You can now use the form to locate and test API calls before you enter the command line. 

Add input parameters to Put, Post, Delete, and Get

This section only applies to API call that require input parameters.


  1. Click the desired API section (Authentication, Infrastructure, Network Services, Security, Support, and Account Management), and then click the desired API call.  
  2. On the right, under Data Type, click Example Value, and then click the example to populate the blank filed under Value.  
  3. On the left, under Value, make your desired changes. 
    • The Parameter content type field must be configured to JSON.
  4. Click Try it out! The fields below will populate with your added changes, including the expected results. You can copy these fields and paste the information into the command line. 


Use the Armor API

Do we offer JSON and XML? Swagger says both, but the PDF simply says JSON.

What information do you need to start off? 

Do you copy / paste the information you see into the command line? Will that mess up the formatting? Yes, you can copy the sample into the command line





Additional information

For more information on the Armor APIs, see Armor API Guide

For more information on the Swagger product, please visit the Swagger website

http://petstore.swagger.io/#/pet


Sample usage