github.com/instill-ai/component@v0.16.0-beta/pkg/connector/restapi/v0/README.mdx (about)

     1  ---
     2  title: "REST API"
     3  lang: "en-US"
     4  draft: false
     5  description: "Learn about how to set up a VDP REST API connector https://github.com/instill-ai/instill-core"
     6  ---
     7  
     8  The REST API component is a data connector that allows users to make requests to external REST APIs.
     9  It can carry out the following tasks:
    10  
    11  - [Get](#get)
    12  - [Post](#post)
    13  - [Patch](#patch)
    14  - [Put](#put)
    15  - [Delete](#delete)
    16  - [Head](#head)
    17  - [Options](#options)
    18  
    19  ## Release Stage
    20  
    21  `Alpha`
    22  
    23  ## Configuration
    24  
    25  The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/pkg/connector/restapi/v0/config/definition.json).
    26  
    27  ## Connection
    28  
    29  | Field | Field ID | Type | Note |
    30  | :--- | :--- | :--- | :--- |
    31  | Authentication (required) | `authentication` | object | Authentication method to use for the REST API |
    32  
    33  ## Supported Tasks
    34  
    35  ### Get
    36  
    37  Send a HTTP GET request.
    38  
    39  | Input | ID | Type | Description |
    40  | :--- | :--- | :--- | :--- |
    41  | Task ID (required) | `task` | string | `TASK_GET` |
    42  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
    43  | Body | `output_body_schema` | string | The request body |
    44  
    45  | Output | ID | Type | Description |
    46  | :--- | :--- | :--- | :--- |
    47  | Status Code | `status_code` | integer | The HTTP status code of the response |
    48  | Body | `body` | any | The body of the response |
    49  | Header | `header` | object | The HTTP header of the response |
    50  
    51  ### Post
    52  
    53  Send a HTTP POST request.
    54  
    55  | Input | ID | Type | Description |
    56  | :--- | :--- | :--- | :--- |
    57  | Task ID (required) | `task` | string | `TASK_POST` |
    58  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
    59  | Body | `body` | any | The request body |
    60  | Body | `output_body_schema` | string | The JSON schema of output body |
    61  
    62  | Output | ID | Type | Description |
    63  | :--- | :--- | :--- | :--- |
    64  | Status Code | `status_code` | integer | The HTTP status code of the response |
    65  | Body | `body` | any | The body of the response |
    66  | Header | `header` | object | The HTTP header of the response |
    67  
    68  ### Patch
    69  
    70  Send a HTTP PATCH request.
    71  
    72  | Input | ID | Type | Description |
    73  | :--- | :--- | :--- | :--- |
    74  | Task ID (required) | `task` | string | `TASK_PATCH` |
    75  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
    76  | Body | `body` | any | The request body |
    77  | Body | `output_body_schema` | string | The JSON schema of output body |
    78  
    79  | Output | ID | Type | Description |
    80  | :--- | :--- | :--- | :--- |
    81  | Status Code | `status_code` | integer | The HTTP status code of the response |
    82  | Body | `body` | any | The body of the response |
    83  | Header | `header` | object | The HTTP header of the response |
    84  
    85  ### Put
    86  
    87  Send a HTTP PUT request.
    88  
    89  | Input | ID | Type | Description |
    90  | :--- | :--- | :--- | :--- |
    91  | Task ID (required) | `task` | string | `TASK_PUT` |
    92  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
    93  | Body | `body` | any | The request body |
    94  | Body | `output_body_schema` | string | The JSON schema of output body |
    95  
    96  | Output | ID | Type | Description |
    97  | :--- | :--- | :--- | :--- |
    98  | Status Code | `status_code` | integer | The HTTP status code of the response |
    99  | Body | `body` | any | The body of the response |
   100  | Header | `header` | object | The HTTP header of the response |
   101  
   102  ### Delete
   103  
   104  Send a HTTP DELETE request.
   105  
   106  | Input | ID | Type | Description |
   107  | :--- | :--- | :--- | :--- |
   108  | Task ID (required) | `task` | string | `TASK_DELETE` |
   109  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
   110  | Body | `body` | any | The request body |
   111  | Body | `output_body_schema` | string | The JSON schema of output body |
   112  
   113  | Output | ID | Type | Description |
   114  | :--- | :--- | :--- | :--- |
   115  | Status Code | `status_code` | integer | The HTTP status code of the response |
   116  | Body | `body` | any | The body of the response |
   117  | Header | `header` | object | The HTTP header of the response |
   118  
   119  ### Head
   120  
   121  Send a HTTP HEAD request.
   122  
   123  | Input | ID | Type | Description |
   124  | :--- | :--- | :--- | :--- |
   125  | Task ID (required) | `task` | string | `TASK_HEAD` |
   126  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
   127  | Body | `output_body_schema` | string | The request body |
   128  
   129  | Output | ID | Type | Description |
   130  | :--- | :--- | :--- | :--- |
   131  | Status Code | `status_code` | integer | The HTTP status code of the response |
   132  | Body | `body` | any | The body of the response |
   133  | Header | `header` | object | The HTTP header of the response |
   134  
   135  ### Options
   136  
   137  Send a HTTP OPTIONS request.
   138  
   139  | Input | ID | Type | Description |
   140  | :--- | :--- | :--- | :--- |
   141  | Task ID (required) | `task` | string | `TASK_OPTIONS` |
   142  | Endpoint Url (required) | `endpoint_url` | string | The API endpoint url |
   143  | Body | `body` | any | The request body |
   144  | Body | `output_body_schema` | string | The JSON schema of output body |
   145  
   146  | Output | ID | Type | Description |
   147  | :--- | :--- | :--- | :--- |
   148  | Status Code | `status_code` | integer | The HTTP status code of the response |
   149  | Body | `body` | any | The body of the response |
   150  | Header | `header` | object | The HTTP header of the response |