InsightConnect Marketplace

REST

Back to Marketplace

REST

v3.0.3

The REST plugin to make it easy to integrate with RESTful services

Tags: rest, http, rpc, microservices, api


Actions
  • DELETE
  • GET
  • PATCH
  • POST
  • PUT

Description

REST, or REpresentational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other. This plugin makes a DELETE, GET, PATCH, POST, or PUT request to the provided URI.

Key Features

  • Use DELETE to delete a resource identified by a URI
  • Use GET to read or retrieve a representation of a resource
  • Use PATCH to update or modify resources
  • Use POST to create new resources
  • Use PUT to update or replace resources

Requirements

  • Varies depending on the API the plugin is interacting with
  • A RESTFUL HTTP/HTTPS resource

Documentation

Setup

Check out the plugin guide for more details on how to configure this plugin.

The connection configuration accepts the following parameters:

Name Type Default Required Description Enum
base_url string None True Base URL e.g. https://httpbin.org None
basic_auth_credentials credential_username_password None False None
default_headers object None False Default headers to include in all requests associated with this connection e.g. None
ssl_verify boolean True True Verify SSL certificate None

Technical Details

Actions

PUT

This action is used to make a PUT request.

Input
Name Type Default Required Description Enum
body object None False Payload to submit to the server when making the REST call None
headers object None False Headers to use for the request. These will override any default headers None
route string None True The route to append to the base URL e.g. /org/users None
Output
Name Type Required Description
body_object object False Response payload from the server as an object
body_string string False Response payload from the server as a string
headers object False Response headers from the server
status int False Status code of the response from the server

Example output:

{
  "body_object": {
    "args": {},
    "data": "{\"hello\": \"world\"}",
    "files": {},
    "form": {},
    "headers": {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "close",
      "Content-Length": "18",
      "Content-Type": "application/json",
      "Host": "httpbin.org",
      "Referer": "https://google.com",
      "User-Agent": "Mozilla/5.0"
    },
    "json": {
      "hello": "world"
    },
    "origin": "73.51.89.6",
    "url": "https://httpbin.org/put"
  },
  "body_string": "{\n  \"args\": {}, \n  \"data\": \"{\\\"hello\\\": \\\"world\\\"}\", \n  \"files\": {}, \n  \"form\": {}, \n  \"headers\": {\n    \"Accept\": \"*/*\", \n    \"Accept-Encoding\": \"gzip, deflate\", \n    \"Connection\": \"close\", \n    \"Content-Length\": \"18\", \n    \"Content-Type\": \"application/json\", \n    \"Host\": \"httpbin.org\", \n    \"Referer\": \"https://google.com\", \n    \"User-Agent\": \"Mozilla/5.0\"\n  }, \n  \"json\": {\n    \"hello\": \"world\"\n  }, \n  \"origin\": \"73.51.89.6\", \n  \"url\": \"https://httpbin.org/put\"\n}\n",
  "status": 200,
  "headers": {
    "Connection": "keep-alive",
    "Server": "gunicorn/19.9.0",
    "Date": "Thu, 13 Sep 2018 15:21:45 GMT",
    "Content-Type": "application/json",
    "Content-Length": "468",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": "true",
    "Via": "1.1 vegur"
  }
}

POST

This action is used to make a POST request.

Input
Name Type Default Required Description Enum
body object None False Payload to submit to the server when making the REST call None
headers object None False Headers to use for the request. These will override any default headers None
route string None True The route to append to the base URL e.g. /org/users None
Output
Name Type Required Description
body_object object False Response payload from the server as an object
body_string string False Response payload from the server as a string
headers object False Response headers from the server
status int False Status code of the response from the server

Example output:

{
  "body_object": {
    "args": {},
    "data": "{\"Best\": \"Komand\"}",
    "files": {},
    "form": {},
    "headers": {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "close",
      "Content-Length": "18",
      "Content-Type": "application/json",
      "Host": "httpbin.org",
      "Referer": "https://google.com",
      "User-Agent": "Mozilla/5.0"
    },
    "json": {
      "Best": "Komand"
    },
    "origin": "73.51.89.6",
    "url": "https://httpbin.org/post"
  },
  "body_string": "{\n  \"args\": {}, \n  \"data\": \"{\\\"Best\\\": \\\"Komand\\\"}\", \n  \"files\": {}, \n  \"form\": {}, \n  \"headers\": {\n    \"Accept\": \"*/*\", \n    \"Accept-Encoding\": \"gzip, deflate\", \n    \"Connection\": \"close\", \n    \"Content-Length\": \"18\", \n    \"Content-Type\": \"application/json\", \n    \"Host\": \"httpbin.org\", \n    \"Referer\": \"https://google.com\", \n    \"User-Agent\": \"Mozilla/5.0\"\n  }, \n  \"json\": {\n    \"Best\": \"Komand\"\n  }, \n  \"origin\": \"73.51.89.6\", \n  \"url\": \"https://httpbin.org/post\"\n}\n",
  "status": 200,
  "headers": {
    "Connection": "keep-alive",
    "Server": "gunicorn/19.9.0",
    "Date": "Thu, 13 Sep 2018 15:20:59 GMT",
    "Content-Type": "application/json",
    "Content-Length": "469",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": "true",
    "Via": "1.1 vegur"
  }
}

PATCH

This action is used to make a PATCH request.

Input
Name Type Default Required Description Enum
body object None False Payload to submit to the server when making the REST call None
headers object None False Headers to use for the request. These will override any default headers None
route string None True The route to append to the base URL e.g. /org/users None
Output
Name Type Required Description
body_object object False Response payload from the server as an object
body_string string False Response payload from the server as a string
headers object False Response headers from the server
status int False Status code of the response from the server

Example output:

{
  "body_object": {
    "args": {},
    "data": "",
    "files": {},
    "form": {},
    "headers": {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "close",
      "Content-Length": "0",
      "Host": "httpbin.org",
      "Referer": "https://google.com",
      "User-Agent": "Mozilla/5.0"
    },
    "json": null,
    "origin": "73.51.89.6",
    "url": "https://httpbin.org/patch"
  },
  "body_string": "{\n  \"args\": {}, \n  \"data\": \"\", \n  \"files\": {}, \n  \"form\": {}, \n  \"headers\": {\n    \"Accept\": \"*/*\", \n    \"Accept-Encoding\": \"gzip, deflate\", \n    \"Connection\": \"close\", \n    \"Content-Length\": \"0\", \n    \"Host\": \"httpbin.org\", \n    \"Referer\": \"https://google.com\", \n    \"User-Agent\": \"Mozilla/5.0\"\n  }, \n  \"json\": null, \n  \"origin\": \"73.51.89.6\", \n  \"url\": \"https://httpbin.org/patch\"\n}\n",
  "status": 200,
  "headers": {
    "Connection": "keep-alive",
    "Server": "gunicorn/19.9.0",
    "Date": "Thu, 13 Sep 2018 15:20:25 GMT",
    "Content-Type": "application/json",
    "Content-Length": "384",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": "true",
    "Via": "1.1 vegur"
  }
}

GET

This action is used to make a GET request.

Input
Name Type Default Required Description Enum
headers object None False Headers to use for the request. These will override any default headers None
route string None True The route to append to the base URL e.g. /org/users None
Output
Name Type Required Description
body_object object False Response payload from the server as an object. Note, if the response has invalid object structure(list, string..) plugin will wrap it with object map
body_string string False Response payload from the server as a string
headers object False Response headers from the server
status int False Status code of the response from the server

Example output:

{
  "body_object": {
    "origin": "73.51.89.6"
  },
  "body_string": "{\n  \"origin\": \"73.51.89.6\"\n}\n",
  "status": 200,
  "headers": {
    "Connection": "keep-alive",
    "Server": "gunicorn/19.9.0",
    "Date": "Thu, 13 Sep 2018 15:19:45 GMT",
    "Content-Type": "application/json",
    "Content-Length": "29",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": "true",
    "Via": "1.1 vegur"
  }
}

DELETE

This action is used to make a DELETE request.

Input
Name Type Default Required Description Enum
body object None False Payload to submit to the server when making the REST call None
headers object None False Headers to use for the request. These will override any default headers None
route string None True The route to append to the base URL e.g. /org/users None
Output
Name Type Required Description
body_object object False Response payload from the server as an object
body_string string False Response payload from the server as a string
headers object False Response headers from the server
status int False Status code of the response from the server

Example output:

{
  "body_object": {
    "args": {},
    "data": "",
    "files": {},
    "form": {},
    "headers": {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "close",
      "Content-Length": "0",
      "Host": "httpbin.org",
      "Referer": "https://google.com",
      "User-Agent": "Mozilla/5.0"
    },
    "json": null,
    "origin": "73.51.89.6",
    "url": "https://httpbin.org/delete"
  },
  "body_string": "{\n  \"args\": {}, \n  \"data\": \"\", \n  \"files\": {}, \n  \"form\": {}, \n  \"headers\": {\n    \"Accept\": \"*/*\", \n    \"Accept-Encoding\": \"gzip, deflate\", \n    \"Connection\": \"close\", \n    \"Content-Length\": \"0\", \n    \"Host\": \"httpbin.org\", \n    \"Referer\": \"https://google.com\", \n    \"User-Agent\": \"Mozilla/5.0\"\n  }, \n  \"json\": null, \n  \"origin\": \"73.51.89.6\", \n  \"url\": \"https://httpbin.org/delete\"\n}\n",
  "status": 200,
  "headers": {
    "Connection": "keep-alive",
    "Server": "gunicorn/19.9.0",
    "Date": "Thu, 13 Sep 2018 15:14:55 GMT",
    "Content-Type": "application/json",
    "Content-Length": "385",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": "true",
    "Via": "1.1 vegur"
  }
}

Triggers

This plugin does not contain any triggers.

Custom Output Types

This plugin does not contain any custom output types.

Troubleshooting

Any headers set in the action will overwrite the default ones in the connection.

Any issues connecting to the remote service should be present in the log of the job that ran. If you find any issues that represent bugs in the plugin itself, please contact someone at Komand directly.

Version History

  • 3.0.3 - Add docs_url to plugin spec with link to plugin setup guide
  • 3.0.2 - Update to v3 Python plugin architecture | Support get endpoints returning lists
  • 3.0.1 - New spec and help.md format for the Extension Library
  • 3.0.0 - Add basic auth support
  • 2.0.0 - Update connection to handle SSL verification
  • 1.0.0 - Update to v2 Python plugin architecture | Support web server mode
  • 0.1.4 - Bug fix for CI tool incorrectly uploading plugins
  • 0.1.3 - Fix post and put actions by using JSON argument instead of body
  • 0.1.2 - SSL bug fix in SDK
  • 0.1.1 - Update tags
  • 0.1.0 - Initial plugin

Links

References

plugin_spec_version: v2
extension: plugin
products: [insightconnect]
name: rest
title: REST
description: The REST plugin to make it easy to integrate with RESTful services
version: 3.0.3
vendor: rapid7
support: community
status: []
resources:
  source_url: https://github.com/rapid7/insightconnect-plugins/tree/master/rest
  license_url: https://github.com/rapid7/insightconnect-plugins/blob/master/LICENSE
  docs_url: https://insightconnect.help.rapid7.com/docs/rest
tags:
- rest
- http
- rpc
- microservices
- api
hub_tags:
  use_cases: [data_utility]
  keywords: [rest, http, rpc, microservices, api]
  features: []
enable_cache: true
connection:
  base_url:
    title: Base URL
    description: Base URL e.g. https://httpbin.org
    type: string
    required: true
  default_headers:
    title: Default Headers
    description: 'Default headers to include in all requests associated with this
      connection e.g. { User-Agent: InsightConnect }'
    type: object
    required: false
  ssl_verify:
    title: SSL Verify
    type: boolean
    description: Verify SSL certificate
    required: true
    default: true
  basic_auth_credentials:
    title: Basic Auth Credentials
    type: credential_username_password
    required: false
actions:
  get:
    title: GET
    description: Make a GET request
    input:
      route:
        title: Route
        description: The route to append to the base URL e.g. /org/users
        type: string
        required: true
      headers:
        title: Headers
        description: Headers to use for the request. These will override any default
          headers
        type: object
        required: false
    output:
      body_object:
        title: Body Object
        description: Response payload from the server as an object. Note, if the response has invalid object structure(list, string..) plugin will wrap it with object map
        type: object
        required: false
      body_string:
        title: Body String
        description: Response payload from the server as a string
        type: string
        required: false
      status:
        title: Status
        description: Status code of the response from the server
        type: int
        required: false
      headers:
        title: Headers
        description: Response headers from the server
        type: object
        required: false
  post:
    title: POST
    description: Make a POST request
    input:
      route:
        title: Route
        description: The route to append to the base URL e.g. /org/users
        type: string
        required: true
      headers:
        title: Headers
        description: Headers to use for the request. These will override any default
          headers
        type: object
        required: false
      body:
        title: Body
        description: Payload to submit to the server when making the REST call
        type: object
        required: false
    output:
      body_object:
        title: Body Object
        description: Response payload from the server as an object
        type: object
        required: false
      body_string:
        title: Body String
        description: Response payload from the server as a string
        type: string
        required: false
      status:
        title: Status
        description: Status code of the response from the server
        type: int
        required: false
      headers:
        title: Headers
        description: Response headers from the server
        type: object
        required: false
  put:
    title: PUT
    description: Make a PUT request
    input:
      route:
        title: Route
        description: The route to append to the base URL e.g. /org/users
        type: string
        required: true
      headers:
        title: Headers
        description: Headers to use for the request. These will override any default
          headers
        type: object
        required: false
      body:
        title: Body
        description: Payload to submit to the server when making the REST call
        type: object
        required: false
    output:
      body_object:
        title: Body Object
        description: Response payload from the server as an object
        type: object
        required: false
      body_string:
        title: Body String
        description: Response payload from the server as a string
        type: string
        required: false
      status:
        title: Status
        description: Status code of the response from the server
        type: int
        required: false
      headers:
        title: Headers
        description: Response headers from the server
        type: object
        required: false
  patch:
    title: PATCH
    description: Make a PATCH request
    input:
      route:
        title: Route
        description: The route to append to the base URL e.g. /org/users
        type: string
        required: true
      headers:
        title: Headers
        description: Headers to use for the request. These will override any default
          headers
        type: object
        required: false
      body:
        title: Body
        description: Payload to submit to the server when making the REST call
        type: object
        required: false
    output:
      body_object:
        title: Body Object
        description: Response payload from the server as an object
        type: object
        required: false
      body_string:
        title: Body String
        description: Response payload from the server as a string
        type: string
        required: false
      status:
        title: Status
        description: Status code of the response from the server
        type: int
        required: false
      headers:
        title: Headers
        description: Response headers from the server
        type: object
        required: false
  delete:
    title: DELETE
    description: Make a DELETE request
    input:
      route:
        title: Route
        description: The route to append to the base URL e.g. /org/users
        type: string
        required: true
      headers:
        title: Headers
        description: Headers to use for the request. These will override any default
          headers
        type: object
        required: false
      body:
        title: Body
        description: Payload to submit to the server when making the REST call
        type: object
        required: false
    output:
      body_object:
        title: Body Object
        description: Response payload from the server as an object
        type: object
        required: false
      body_string:
        title: Body String
        description: Response payload from the server as a string
        type: string
        required: false
      status:
        title: Status
        description: Status code of the response from the server
        type: int
        required: false
      headers:
        title: Headers
        description: Response headers from the server
        type: object
        required: false
Other plugins
Ivanti Security Controls
Rapid7   |   v1.5.0
Plugin
Get
McAfee ePO
Rapid7   |   v5.0.0
Plugin
Get
BlackBerry CylancePROTECT
Rapid7   |   v1.1.0
Plugin
Get
Fortinet FortiGate
Rapid7   |   v4.0.4
Plugin
Get
Jira
Rapid7   |   v6.0.1
Plugin
Get