Page tree

Versions Compared

Key

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

Overview

...

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

What's the point of Swagger? Is this a replacement for the command line? Or, is it simply a testing tool to help you learn before you go into the command line? 

Access the Armor API in Swagger

Just Json

How do I access Swagger? Do I need to log in? If so, how? 

  1. Go to AMP. 
  2. Find your Authorization code. 
  3. Find your X-Account Access code. 
  4. Go to apidoc.tde.armorlabs.co.
  5. Enter your authorization and X-Account-Context, and then click Authorize. You can now use the form to locate and test API calls before you enter the command line. 

To add your input into a call for Put, Post, Delete

  1. click the call header (Account), and then click the specific call. 
  2. On the right, under Model / Example value, click the box. 
  3. On the left, under value, that fied will be populated. There, enter your changes. 
  4. And then click Try it out!
  5. This will show you the expected results. 
  6. In the Model / Example Value, click a sample 

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

...

 

The interactive Armor API is divided into the following six sections: 

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

Access the interactive Armor API

...

To access the interactive Armor API, you must use your AMP login information to retrieve authorization keys.

There are two high-level steps to authenticate:

Step 1: Locate your Account Number

  1. Log into the Armor Management Portal (AMP).
  2. On the left-side navigation, click Account
  3. Copy the number in Account Number
  4. Access the interactive Armor API (https://developer.armor.com/).  
  5. In the X-Account-Context field, enter the copied Account Number

Step 2: Locate Your Authorization Code, and then Authenticate

  1. Access the interactive Armor API (https://developer.armor.com/). 
  2. Click the Authentication section. 
  3. Click POST /auth/authorize
  4. On the right side, under Data Type, click Example Value
  5. Click the yellow field below Example Value. 
    • This action will populate the empty field on the left. 
  6. On the left, in the field under Value, remove the sample login credentials, and then enter your AMP username and password.  
    • Do not remove the quotation marks. 
  7. In Parameter content type, select application/json
  8. Click Try it out!
    • If you have multi-factor authentication (MFA) set up for your AMP account, then you will need to authenticate in order to receive the code. 
  9. Under Response Body, copy the code, including the equal sign ( = ); however, do not copy the quotation marks.
  10. Locate and select POST /auth/token
  11. On the right side, under Data Type, click Example Value
  12. Click the yellow field below Example Value.
    • This action will populate the empty field on the left.  
  13. On the left, in the field under Value, remove the sample code, and then paste your code.
    • Do not remove the quotation marks. 
  14. In Parameter content type, select application/json
  15. Click Try it out!
    • This will display the access_token
  16. Under Response Body, copy the access_token
  17. Scroll up, and then in the Authorization field, enter FH-AUTH, followed by the copied access_token
    • A typical authorization credential should display as FH-AUTH afecb1543c3de8654.
  18. Click Authorize
    • The screen will refresh.

Add Input Parameters to Put, Post, Delete, and Get API Calls 

...

Note

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

Note

Although the button to execute the call is displayed as Try it out!, the interactive Armor API guide is a live version of the Armor API. These calls will cause real-time changes to your environment.

  1. Click the desired API section (Account Management, Infrastructure, Authentication, Security, Network Services, Support), and then click the desired API call.  
  2. On the right, under Data Type, click Example Value.
  3. Click the yellow field below Example Value. 
    • This action will populate the empty field on the left. 
  4. On the left, in the field under Value, remove the sample code, and then make your desired changes. 
  5. In Parameter content type, select application/json
  6. Click Try it out! 
    • The fields below will populate with your changes, including the expected results. You can copy these fields and paste the information 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





Excerpt
hiddentrue

test

  1. (Optional) You can click Authentication, and then click Get / me to find the account number for your other accounts. 
  2. Step 2: Locate your authorization code

    There are two ways to authenticate into the tool: 

    • Via the API tool and AMP
    • Via the command line


    Via Swagger and AMP



Via the command line how to handle a user with multiple accounts

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

    Code Block
    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. 

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

    Code Block
    POST /auth/token
     
    {
      "code":"<<base64-hash>>"
      "grant_type":"authorization_code"
    }
  4. If the request is successful, you will receive the access token (access_token). You must redeem this token within two minutes of the previous request. Review the following example. 

    Code Block
    {
     "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 for the account. 
    • You can use the GET https://api.armor.com/me API to find the account ID (id)
  8. Click Authorize. You can now use the form to locate and test API calls before you enter the command line.