diff --git a/content/_components/git-protocol/index.md b/content/_components/git-protocol/index.md index cd5a1c27..bfac43c8 100644 --- a/content/_components/git-protocol/index.md +++ b/content/_components/git-protocol/index.md @@ -10,27 +10,18 @@ ComponentVersion: 1.2.5 updatedDate: 2024-09-04 --- -## Table of Contents -* [General information](#general-information) - * [Description](#description) -* [Credentials](#credentials) -* [Actions](#actions) - * [Create Commit](#create-commit) - * [Config Fields](#config-fields) - * [Input Metadata](#input-metadata) - * [Output Metadata](#output-metadata) - * [Read from Branch](#read-from-branch) - * [Config Fields](#config-fields) - * [Input Metadata](#input-metadata) - * [Output Metadata](#output-metadata) - ## General information + ### Description -Git protocol component for the [elastic.io platform](http://www.elastic.io "elastic.io platform") + +Git protocol component for the [{{site.data.tenant.name}} platform](http://www.{{site.data.tenant.name}}) ## Credentials -- Passphrase (string/text box, optional): Passphrase to use to authenticate. -- Private SSH Key (string/text box, required): Private SSH key to use to authenticate. Example: + +- Passphrase (string/text box, optional): Passphrase to use to authenticate +- Public SSH Key (string/text box, required): Public SSH key to use to authenticate + +Example: ``` -----BEGIN RSA PRIVATE KEY----- @@ -40,44 +31,54 @@ jnJHBGH68t76ghvdsaHJVH66657VCHHcEZD+aVRKDQwjIosXR8r88b== -----END RSA PRIVATE KEY----- ``` -
- Technical details -The only field available on Elastic's UI to provide a secure input is a 'PasswordFieldView' view class. The problem is that it replaces new line characters with spaces. -This method modifies the key in the following way. E.g. the key is: +> **Please note** that you need to add your SSH key to the server (GiHub, GitLab, etc.) first! + +- Service URL (string, required): Url of the service to test the SSH key for validity + +Example: ``` - -----BEGIN RSA PRIVATE KEY----- - BASE64_ENCODED_DATA_LINE_1 - BASE64_ENCODED_DATA_LINE_2 - BASE64_ENCODED_DATA_LINE_3 - -----END RSA PRIVATE KEY----- +git@github.com ``` -The platform will then transform the key so: - ------BEGIN RSA PRIVATE KEY----- BASE64_ENCODED_DATA_LINE_1 BASE64_ENCODED_DATA_LINE_2 BASE64_ENCODED_DATA_LINE_3 -----END RSA PRIVATE KEY----- +- Git Project (string, required): Part of the git repo URL that is after the service URL. (e.g. If the Git Project is acme/git-protocol-component.git and the Service URL is git@github.com, then the full git URL should be git@github.com:acme/git-protocol-component.git -The code in the component replaces all the space characters (except for in the header and footer lines) with new line characters -
+- Private SSH Key (string/text box, required): Private SSH key to use to authenticate -- Public SSH Key (string/text box, required): Public SSH key to use to authenticate. Example: +Example: ``` ssh-rsa AAAAB3NzaC1yc2EAAAAD{.....}kf0vBMStV user@exampleHost ``` -Please note that you need to add your SSH key to the server (GiHub, GitLab, etc.) first! -- Service URL (string, required): Url of the service to test the SSH key for validity. Example: +### Technical details +The only field available on Platform UI to provide a secure input is a 'PasswordFieldView' view class. The problem is that it replaces new line characters with spaces. +This method modifies the key in the following way. E.g. the key is: ``` -git@github.com + -----BEGIN RSA PRIVATE KEY----- + BASE64_ENCODED_DATA_LINE_1 + BASE64_ENCODED_DATA_LINE_2 + BASE64_ENCODED_DATA_LINE_3 + -----END RSA PRIVATE KEY----- ``` -- Git Project (string, required): Part of the git repo URL that is after the service URL. (e.g. If the Git Project is elasticio/git-protocol-component.git and the Service URL is git@github.com, then the full git URL should be git@github.com:elasticio/git-protocol-component.git +The platform will then transform the key so: + +-----BEGIN RSA PRIVATE KEY----- BASE64_ENCODED_DATA_LINE_1 BASE64_ENCODED_DATA_LINE_2 BASE64_ENCODED_DATA_LINE_3 -----END RSA PRIVATE KEY----- + +The code in the component replaces all the space characters (except for in the header and footer lines) with new line character + +## Triggers + +This component has no trigger functions. This means it will not be accessible to +select as a first component during the integration flow design. ## Actions + ### Create Commit + This action does the equivalent to - git clone - git checkout @@ -89,7 +90,7 @@ This action does the equivalent to #### Config Fields - File Source. One of the following: - - Maester. Elastic's internal object storage + - Internal object storage - URL. Internet (must be publicly available. Authentication mechanisms are not supported) #### Input Metadata @@ -106,8 +107,8 @@ This action does the equivalent to - Date (string, optional: default to now). Time (in seconds from epoch) when the action happened - Files to add to commit (array, required) - File Source Meta (string, required): Dynamically generated. Will be one of the following depending on File Source chosen in the configuration: - - Configuration `Maester Object ID or Maester URL`: - either ID of the object in Maester (e.g. `797bb70d-1590-4136-b9db-2abb01983d92`) or the full Maester object URL (e.g. `http://maester-service.platform.svc.cluster.local:3002/objects/dbceb3f1-6d18-4eb4-9f08-2437b6ef685f?storage_type=maester`)) - - Configuration `External URL`: External link to the file (e.g. `https://example.com/file.txt`). Must be publicly available. Authentication mechanisms are not supported + - Configuration 'Maester Object ID or Maester URL': - either ID of the object in Maester (e.g. `797bb70d-1590-4136-b9db-2abb01983d92`) or the full Maester object URL (e.g. `http://maester-service.platform.svc.cluster.local:3002/objects/dbceb3f1-6d18-4eb4-9f08-2437b6ef685f?storage_type=maester`)) + - Configuration 'External URL': External link to the file (e.g. `https://example.com/file.txt`). Must be publicly available. Authentication mechanisms are not supported - Filename + path (string, required): Location within the git repo to create the file - Files to remove from the commit (array of strings, optional): List of files or file wildcards to remove as part of the commit. (equivalent to `git rm -r fileOne.txt fileTwo.txt someFolder`) @@ -116,6 +117,7 @@ This action does the equivalent to * commitId - ID of the commit in the repo ### Read from Branch + This action reads the files from a Git repository and saves them in Maester (Elastic's internal object storage) #### Config Fields @@ -132,14 +134,16 @@ This action reads the files from a Git repository and saves them in Maester (Ela * commitId - ID of the commit in the repo #### File patterns usage -Internally this library is being used to find the wildcards/patterns match: [https://www.npmjs.com/package/fast-glob](https://www.npmjs.com/package/fast-glob) + +Internally this library is being used to find the wildcards/patterns match: https://www.npmjs.com/package/fast-glob Examples: + 1. Match all the files including all subdirectories (also note that 'Include hidden files' configuration field might affect the result): `'**'` 2. Match all the files of js type: `'**/*.js'` 3. Match a single file in the root folder: `'component.json'` 4. Match all the files in the given 'lib' folder: `'lib/**'` ## Known limitations + 1. Maester object created by Sailor's Lightweight message feature can not be read (to be precise - they will be processed but not decrypted) -2. The repository must be initialized before executing the `Create Commit` action. This means that the repository must contain at least one commit (initial commit). diff --git a/content/_components/hubspot/index.md b/content/_components/hubspot/index.md index b6a81acd..1f412259 100644 --- a/content/_components/hubspot/index.md +++ b/content/_components/hubspot/index.md @@ -14,280 +14,285 @@ redirect_from: - /components/hubspot-component/triggers --- -# HubSpot component - -## Table of Contents -* [General information](#general-information) - * [Description](#description) - * [Completeness Matrix](#completeness-matrix) - * [Environment variables](#environment-variables) -* [Credentials](#credentials) -* [Triggers](#triggers) - * [Get New and Updated Objects](#get-new-and-updated-objects) - * [Deprecated triggers](#deprecated-triggers) -* [Actions](#actions) - * [Raw Request](#raw-Request) - * [Upsert](#upsert) - * [Lookup Set Of Objects By Unique Criteria](#lookup-set-of-objects-by-unique-criteria) - * [Lookup Object (at most one)](#lookup-object-at-most-one) - * [Lookup Objects (Plural)](#lookup-objects-plural) - * [Create Association](#create-association) - * [Remove Association](#remove-association) - * [Delete Object](#delete-object) -* [Known Limitations](#known-limitations) ## General information -### Description -[elastic.io](http://www.elastic.io;) iPaaS component that connects to Hubspot API -### Completeness Matrix -![image](https://user-images.githubusercontent.com/30211658/141339015-835ede31-70c7-49b6-afde-19dea8c0fc12.png) -[Completeness Matrix](https://docs.google.com/spreadsheets/d/1EBZNhv4VP9NUpsT1FNO89SKW2DHqe9DbrHRU8Kwjj8o/edit#gid=0) +{{page.description}} ### Environment variables | Name | Mandatory | Description | Values | |----|---------|-----------|------| -| `REQUEST_MAX_RETRY` | false | Set how many time system try to make request to API on errors (3 by default) | any `integer` above 0 | -| `RENEW_LIMIT` | false | Set biggest number of records in `Get New and Updated Objects` trigger before set new start date, 9800 by default | any `integer` above 0 and less 10000 | +| `REQUEST_MAX_RETRY` | false | The number of retries to HubSpot API the platform should do on errors (3 by default) | any `integer` above 0 | +|`RENEW_LIMIT`| false | Set biggest number of records in `Get New and Updated Objects` trigger before set new start date, 9800 by default | any `integer` above 0 and less 10000| ## Credentials -Authentication occurs via OAuth 2.0. -In order to make OAuth work, you need a new App in your Hubspot. -More information you can find [here](https://developers.hubspot.com/docs/api/working-with-oauth). +Authentication occurs via OAuth 2.0. To make OAuth work, you need to +[create a new OAuth2 App](creating-oauth-app-for-hubspot) in your HubSpot or use +an existing OAuth2 Client during the credentials creation process. -After granting access, you should be redirected back to our platform via a `redirect_url`. To do this, you will need to provide our [OAuth Callback Redirect URL](https://docs.elastic.io/guides/oauth-callback-redirect-url.html). +{% include img.html max-width="100%" url="img/hubspot-credentials-screen.png" title="Oauth2" %} -During credentials creation you would need to: -- select existing Auth Client from drop-down list ``Choose Auth Client`` or create the new one. -For creating Auth Client you should specify following fields: +* Leave the **Additional parameters** input empty. +* Provide the following value in the **Scopes** input. If you wish to grant certain permissions, you can do so by removing them from this list. -Field name|Mandatory|Description| -|----|---------|-----------| -|Name| true | your Auth Client's name (any) | -|Client ID| true | your OAuth client key (provide by Hubspot) | -|Client Secret| true | your OAuth client secret (provide by Hubspot) | -|Authorization Endpoint| true | your OAuth authorization endpoint. ex:
`https://app-eu1.hubspot.com/oauth/authorize` -|Token Endpoint| true | your OAuth Token endpoint for refreshing access token:
`https://api.hubapi.com/oauth/v1/token`| +``` +crm.objects.contacts.read, crm.objects.contacts.write, crm.schemas.contacts.read, crm.schemas.contacts.write, crm.objects.owners.read +``` -![ksnip_20210924-154946](https://user-images.githubusercontent.com/7985390/134677237-b9aedd64-e7c0-4489-9125-f476cc129e31.png) -- fill field ``Name Your Credential`` (any) -- fill field ``Scopes`` - must be the same as provided during app creation in Hubspot, use space separated list (not comma), ``crm.objects.owners.read`` is required for verification -![ksnip_20210924-160402](https://user-images.githubusercontent.com/7985390/134678850-0a8880a7-fb98-4b2e-9dc0-560ae93364db.png) -![ksnip_20210924-160400](https://user-images.githubusercontent.com/7985390/134678845-eae59b7f-3e5d-4519-8353-a95b23926130.png) +To complete the process: -- click on ``Authenticate`` button - if you have not logged in Hubspot before, then log in by entering data in the login window that appears -- click on ``Verify`` button for verifying your credentials -- click on ``Save`` button for saving your credentials +* click on **Authenticate** button - if you have not logged into HubSpot before, then log in by entering data in the login window that appears +* click on **Verify** button for verifying your credentials +* click on **Save** button for saving your credentials. ## Triggers + ### Get New and Updated Objects -### Config Fields - * **Object Type** Dropdown: Indicates Object Type to be fetched - * **Emit behavior** Dropdown: Indicates emit objects individually or emit by page - * **Field to poll** Dropdown: Indicates field to poll (new objects or modified objects) - * **Start Time** - TextField (string, optional): Indicates the beginning time to start retrieving events from - * **End Time** - TextField (string, optional, defaults to never): If provided, don’t fetch records modified after this time - * **Size of Polling Page** - TextField (optional, positive integer, max 100, defaults to 100): Indicates the size of pages to be fetched - * **Single Page per Interval** - Checkbox: Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page immediately, wait until the next flow start to fetch the next page. This field will be ignored if `Max amount of Polling Pages` field is set. - * **Max amount of Polling Pages** - TextField (optional, positive integer, max 1000, defaults to 1000): Indicates the maximum amount of pages to be fetched per execution + +{% include img.html max-width="100%" url="img/get-new-and-updated-objects.png" title="Get New and Updated Objects" %} + +### Configuration Fields + +* **Object Type** dropdown: Select an Object Type to fetch. +* **Emit behavior** dropdown: Choose between **emit objects individually** or **emit by page** options. +* **Field to poll** dropdown: Used to select the field to poll (new objects or modified objects). +* **Start Time** - Text field (string, optional): Used to set the time from which to start retrieving events. +* **End Time** - Text field (string, optional, defaults to never): When provided, don’t fetch records modified after this time. +* **Size of Polling Page** - Text field (optional, positive integer, max 100, defaults to 100): Set the size of the fetched pages. +* **Single Page per Interval** - Checkbox: Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page at once, wait until the next flow start to fetch the next page. +* **Max amount of Polling Pages** - TextField (optional, positive integer, max 1000, defaults to 1000): Indicates the maximum amount of pages to be fetched per execution. #### Output Metadata -- For `Fetch page`: An object with key ***results*** that has an array as its value -- For `Emit Individually`: Each object fill the entire message -### Limitations -After reaching **9800** records flow will find largest `Field to poll` in last Polling Page and use it as `Start Time` for next iterations, results with this date will be excluded from that iteration and include in the next one +- For `Fetch page`: An object with key ***results*** that has an array as its value. +- For `Emit Individually`: Each object fill the entire message. -### Deprecated triggers +#### Limitations -#### Webhook +After reaching **9800** records flow will find largest `Field to poll` in last Polling Page and use it as `Start Time` for next iterations, results with this date will be excluded from that iteration and include in the next one. -❗This trigger is deprecated, please use Hubspot webhook component instead. +### Webhook -Receive data from HubSpot based on configured [webhooks](https://developers.hubspot.com/docs/api/webhooks) +> This trigger is deprecated. Please use [HubSpot Webhook component](/components/hubspot-webhook/) instead. -##### Config Fields +Receive data from HubSpot based on configured [webhooks](https://developers.hubspot.com/docs/api/webhooks). - * **Client secret** - You need provide Client secret from HubSpot application here +### Configuration Fields - ❗You will get error during webhook requests if this field will be incorrect +**Client secret** - Provide Client secret from HubSpot application here otherwise you will get an error during the webhook requests in case of incorrect or missing value. -##### Output Metadata +#### Output Metadata -Triggered object from HubSpot +Triggered object from HubSpot. ## Actions + ### Raw Request -Action to call any Hubspot API endpoint -#### Config Fields -* **Throw Error on 404 Response** - (optional) Treat 404 HTTP responses as errors, defaults to `false`. +Action to call any Hubspot API endpoint. + +{% include img.html max-width="100%" url="img/raw-request.png" title="Raw Request" %} + +#### Configuration Fields + +**Throw Error on 404 Response** - (optional) Treat 404 HTTP responses as errors, defaults to `false`. #### Input Metadata -* **Url** - Path of the resource relative to the URL base (https://api.hubapi.com), required. -* **Method** - Allowed values `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, required. HTTP verb to use in the request. -* **Request Body** - Body of the request to send + +* **URL** - Path of the resource relative to the URL base (`https://api.hubapi.com`), required. +* **Method** - Allowed values `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, required. HTTP verb to use in the request. +* **Request Body** - Body of the request to send. ### Upsert -Action to make upsert(update/create) object in Hubspot -#### Config Fields -* **Object type** - Object type for upsert ("Companies", "Contacts", "Deals", "Line Items", "Tickets") -* **ID to Search On** - Identificator to search object ("Hubspot Id" or "Email". "Email" is only for "Contacts" `Object Type`) +Action to make upsert (update/create) object in HubSpot. + +{% include img.html max-width="100%" url="img/upsert-object.png" title="Upsert" %} + +#### Configuration Fields + +* **Object type** - Object type for upsert like `Companies`, `Contacts`, `Deals`, `Line Items` or `Tickets`. +* **ID to Search On** - Identifier to search objects like **HubSpot Id** or **Email**. Use **Email** for `Object Type` in the **Contacts**. #### Input Metadata -Dynamically generated -For each custom file field, it is generated an object to upload the custom file to populate that field. That object includes the following: +Dynamically generated. + +For each custom file field, an object is generated to upload the custom file to populate that field. That object includes the following: + +* Attachment URL (URL containing the file contents to upload) +* Folder Path +* File Name +* Charset Hunch +* Access +* TTL +* Overwrite +* Duplicate Validation Strategy +* Duplicate Validation Scope - * Attachment URL (URL containing the file contents to upload) - * Folder Path - * File Name - * Charset Hunch - * Access - * TTL - * Overwrite - * Duplicate Validation Strategy - * Duplicate Validation Scope +We use [Files API](https://developers.hubspot.com/docs/api/files/files) for file uploading. -For uploading file [Files API](https://developers.hubspot.com/docs/api/files/files) is used. +#### Known limitations + +Please, don't use platform attachments url (like `http://steward-service.platform.svc.cluster.local:8200/v2/objects/xxxxx`) for fields `Attachment URL`. The component will throw an exception `process.uncaughtException`. ### Lookup Set Of Objects By Unique Criteria -Action to lookup object in Hubspot. + +Action to lookup object in HubSpot. Lookup Set will make sure all the items in the set should be there, otherwise throw an error. -#### Config Fields +{% include img.html max-width="100%" url="img/lookup-set-of-objects.png" title="Lookup Set Of Objects By Unique Criteria" %} -* **Object type** - Object type for lookup ("Companies", "Contacts", "Deals", "Line Items", "Tickets", "Quotes") -* **ID to Search On** - Identification to search object ("Hubspot Id" or "Email". "Email" is only for "Contacts" `Object Type`) -* **Enable download attachments** - Checkbox for enabling downloading attachments from fields with type `file` +#### Configuration Fields + +* **Object type** - Object type for lookup like `Companies`, `Contacts`, `Deals`, `Line Items` or `Tickets`. +* **ID to Search On** - Identifier to search objects like **HubSpot Id** or **Email**. Use **Email** for `Object Type` in the **Contacts**. +* **Enable download attachments** - Checkbox for enabling attachment download for the `file` field type #### Input Metadata -An array where each item is an ID + +An array where each item is an ID. ### Lookup Object (at most one) -Action designed to lookup one object by unique field -#### Config Fields -* **Object Type** Dropdown: Indicates Object Type to find -* **ID to Search On** Dropdown: Indicates unique field to search on -* **Allow ID to be omitted** Checkbox: When selected, the ID field becomes optional, otherwise it is a required field -* **Allow zero results** Checkbox: When selected, if zero results are returned, the empty object {} is emitted, otherwise typically an error would be thrown. -* **Enable download attachments** - Checkbox for enabling downloading attachments from fields with type `file` +Action designed to lookup one object by unique field. -#### Input Metadata -* **ID value** Textfield: value for `ID to Search On` (unique field value by itself) +{% include img.html max-width="100%" url="img/lookup-object-at-most-one.png" title="Lookup Object (at most one)" %} + +#### Configuration Fields +* **Object Type** dropdown: Select an Object Type to lookup. +* **ID to Search On** dropdown: Used to search a unique field. +* **Allow ID to be omitted** Checkbox: Select to make the ID field optional (default: required). +* **Allow zero results** Checkbox: Select to allow zero results. System will emit an empty object `{}`, otherwise system will through an error in case of zero results. +* **Enable download attachments** - Checkbox for enabling attachment download for the `file` field type. -
+#### Input Metadata + +**ID value** Text field: value for `ID to Search On` (unique field value by itself). ### Lookup Objects (Plural) -Action to lookup objects in Hubspot -#### Config Fields +Action to lookup objects in HubSpot. + +{% include img.html max-width="100%" url="img/lookup-objects.png" title="Lookup Objects (Plural)" %} -* **Object Type** Dropdown: Indicates Object Type to find -* **Behaviour** Dropdown with options: `Fetch all`, `Fetch page`, `Emit individually`, required -* **Enable download attachments** - Checkbox for enabling downloading attachments from fields with type `file` +#### Configuration Fields -
+* **Object Type** dropdown: Select an Object Type to find. +* **Behaviour** dropdown with options: `Fetch all`, `Fetch page`, `Emit individually`, required. +* **Enable download attachments** - Checkbox for enabling attachment download for the `file` field type. #### Input Metadata -* **Search Criteria** Array: Search terms are to be combined with the AND operator. For each search term. +**Search Criteria** Array: Combine each search term with an `AND` operator. -❗HubSpot support up to three criteria +> **Please note:** HubSpot support up to three criteria Example: -> -> -> Records created after *'2021-10-01T03:30:17.883Z'* with property *'firstname'* contains *'Tony'* -> ``` -> ["createdate GT 1633059017883", "firstname CONTAINS_TOKEN Tony"] -> ``` +Records created after `2021-10-01T03:30:17.883Z` with property `firstname` containing `Tony`. + +``` +["createdate GT 1633059017883", "firstname CONTAINS_TOKEN Tony"] +``` Supported operators: -|OPERATOR|DESCRIPTION| -|----|------| -|EQ | equal to| -|NEQ | not equal to| -|LT | less than| -|LTE | less than or equal to| -|GT | greater than| -|GTE | greater than or equal to| -|HAS_PROPERTY | has property value| -|NOT_HAS_PROPERTY | does not have property value| -|CONTAINS_TOKEN | contains token| -|NOT_CONTAINS_TOKEN | does not contain token| +| OPERATOR | DESCRIPTION | +| ---- | ------ | +| `EQ` | equal to | +| `NEQ` | not equal to | +| `LT` | less than | +| `LTE` | less than or equal to | +| `GT` | greater than | +| `GTE` | greater than or equal to | +| `HAS_PROPERTY` | has property value | +| `NOT_HAS_PROPERTY` | does not have property value | +| `CONTAINS_TOKEN` | contains token | +| `NOT_CONTAINS_TOKEN` | does not contain token | If selected `Fetch page` additional metadata fields: -* **Page Size** - Number of records to retrieve, limit - 100 -* **Page Number** - How many pages should be skipped -* **Order** - Order direction, **ASCENDING** or **DESCENDING** +* **Page Size** - Number of records to retrieve, limit - 100. +* **Page Number** - Number of pages to skip. +* **Order** - Order direction, **ASCENDING** or **DESCENDING** Order example: -> -> ``` -> 'createdate DESCENDING' -> ``` -
+ +``` +'createdate DESCENDING' +``` #### Output Metadata -- For `Fetch page`: An object with: - - key ***results*** that has an array as its value - - key ***totalCountOfMatchingResults*** which contains the total number of results (not just on the page) which match the search criteria -- For `Fetch All`: An object, with key ***results*** that has an array as its value -- For `Emit Individually`: Each object fill the entire message +* For `Fetch page`: An object with: + * key `results` that has an array as its value. + * key `*totalCountOfMatchingResults` containing the total number of results (not just on the page) matching the search criteria. +* For `Fetch All`: An object, with key `*results` that has an array as its value. +* For `Emit Individually`: Each object fill the entire message. ### Create Association -#### Config Fields +{% include img.html max-width="100%" url="img/create-associations.png" title="Create Association" %} + +#### Configuration Fields + +* **From Object Type** dropdown: Choose an object type to create association. +* **To Object Type** dropdown: Choose an object type to associate to. -* **From Object Type** Dropdown: Choose from which object needs to create association -* **To Object Type** Dropdown: Choose to what object +> **Please note**: We do not retrieve objects to associate dynamically. Check the +> HubSpot documentation to verify that the association between selected objects is possible. -❗*NOTE*: Objects to assosiate are not dinamically retrieved, so please make sure in Hubspot documentation that selected objects can be assosiated #### Input Metadata -* **From Object ID** - HubSpot id of object which needs to create association -* **To Object ID** - id of associated object + +* **From Object ID** - HubSpot id of object which needs to create association. +* **To Object ID** - id of associated object. #### Output Metadata -Object with key ***statusCode*** that represent result of request +Object with `statusCode` key that represent result of request. ### Remove Association -#### Config Fields +{% include img.html max-width="100%" url="img/remove-associations.png" title="Remove Association" %} + +#### Configuration Fields + +* **From Object Type** dropdown: Choose from which object to remove association. +* **To Object Type** dropdown: Choose to which object. -* **From Object Type** Dropdown: Choose from which object needs to remove association -* **To Object Type** Dropdown: Choose to what object +> **Please note**: We do not retrieve objects to associate dynamically. Check the +> HubSpot documentation to verify that the association between selected objects is possible. -❗*NOTE*: Objects to assosiate are not dinamically retrieved, so please make sure in Hubspot documentation that selected objects can be assosiated #### Input Metadata -* **From Object ID** - HubSpot id of object which needs to remove association -* **To Object ID** - id of associated object + +* **From Object ID** - HubSpot id of object which needs to remove association. +* **To Object ID** - id of associated object. #### Output Metadata -Object with key ***statusCode*** that represent result of request +Object with `statusCode` key that represent result of request. ### Delete Object -Action designed to delete one object by unique field -#### Config Fields -* **Object Type** Dropdown: Indicates Object Type to find -* **ID to Search On** Dropdown: Indicates unique field to search on +Action designed to delete one object by unique field. + +{% include img.html max-width="100%" url="img/delete-object.png" title="Delete Object" %} + +#### Configuration Fields + +* **Object Type** dropdown: Indicates Object Type to find. +* **ID to Search On** dropdown: Indicates unique field to search on. #### Input Metadata -* **ID value** Textfield: value for `ID to Search On` (unique field value by itself) + +**ID value** text field: value for `ID to Search On` (unique field value by itself). #### Output Metadata + The expected output is an object with a `id` property. `id` value stands for id of delete object. +## Known Limitations -# Known Limitations -1. [Rate Limits](https://developers.hubspot.com/docs/api/usage-details#rate-limits) -2. Please, use some timer (around 5sec) if you are going to implement flow like `Upsert Object Action` -> any type of `Lookup Object(s) Action` with enabled feature `Enable download attachments`. Uploading the file to Hubspot on `Upsert Object Action` takes some time, so it is possible to receive `404` error on lookup. +1. [Rate Limits](https://developers.hubspot.com/docs/api/usage-details#rate-limits). +2. Please, use a timer (around 5 seconds) if you need to build a flow like `Upsert Object Action` -> any type of `Lookup Object(s) Action` with enabled feature `Enable download attachments`. Uploading the file to HubSpot on `Upsert Object Action` takes some time, your might get `404` error on lookup. diff --git a/content/_components/netsuite/actions.md b/content/_components/netsuite/actions.md new file mode 100644 index 00000000..53e1a4fd --- /dev/null +++ b/content/_components/netsuite/actions.md @@ -0,0 +1,1178 @@ +--- +title: NetSuite actions +layout: component +description: NetSuite component actions. +icon: netsuite.png +icontext: NetSuite component +category: netsuite +updatedDate: 2023-05-26 +ComponentVersion: 3.1.0 +--- + +## Add Object + +Add an object to NetSuite. + +### Configuration Fields + +* **Object Category** - a category of an object in NetSuite + * Standard + * Custom +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. + +### Input Metadata + +Is being fetched dynamically. Sample: + +
Input metadata for invoice object + +```json +{ + "entity": { + "internalId": "5" + }, + "currency": { + "internalId": "1" + }, + "tranDate": "2023-05-23", + "itemList": { + "item": [ + { + "description": "General Donation", + "amount": 1000, + "item": { + "internalId": "12" + }, + "quantity": 1, + "rate": "100", + "taxCode": { + "internalId": "5" + }, + "customFieldList": { + "customField": [ + { + "type": "SelectCustomFieldRef", + "scriptId": "asd_d3", + "value": { + "name": "Charity type", + "internalId": "2" + } + } + ] + } + } + ] + }, + "customFieldList": { + "customField": [ + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-one", + "value": "Bank Transfer" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-two", + "value": "Individual One-Off" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-three", + "value": "John Doe" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-four", + "value": "ABC-987" + } + ] + } +} +``` +
+ +## Delete Object By Id + +Deletes an object by the ID provided. + +![Delete Object By Id](img/delete-by-id.png) + +### Configuration Fields + +* **Object Category** - a category of an object in NetSuite: + + * Standard + * Custom + +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. + +### Input Metadata + +Is being fetched dynamically. The sample: + +Input metadata for Transaction objects: + +```json +{ + "internalId": "string", + "externalId": "string", + "deletionReasonCode": "deleteionReasonCodeString", + "deletionReasonMemo": "deletionReasonMemoString" +} +``` + +
Deletion Reason Usage Notes: + +> **Please Note:** the following about the deletionReason parameter: + +>The deletionReason complex type includes two fields: deletionReasonCode and deletionReasonMemo. The deletionReasonCode must identify a deletion reason that is listed at Setup > Accounting > Accounting Lists. If the Use Deletion Reasons feature is enabled and you use the deletionReasonCode to identify a code that does not exist, the request fails with an INVALID_REF_KEY error. + +> Deletion reasons can be saved only for transactions. However, in SOAP web services, you must use the deletionReason parameter even when referencing other record types, and even when the Use Deletion Reasons feature is not enabled. For situations where it is not appropriate to identify a deletion reason, pass in a value of null. + +> Even when a deletion reason is required, you can use a value of null. In these cases, the system automatically populates the deletion reason fields with default values. These defaults are: Other for deletionReasonCode and This transaction was deleted by script or web service for deletionReasonMemo. + +> The deletionReason complex type is defined in the core XSD. + +> For more details about the Use Deletion Reasons feature, see Recording a Reason for Deleting a Transaction. + +
+ +Input metadata for other objects: + +```json +{ + "internalId": "string", + "externalId": "string" +} +``` + +### Output Metadata + +```json +{ + "internalId": "string" +} +``` +## Get Item Availability +Allows to get an item availability based on its type and internal ID provided + +### Get Item Availability. Config fields +* **Item Type** - item type to search for. One of: + * Assembly Item + * Description Item + * Discount Item + * Download Item + * Inventory Item + * Gift Certificate Item + * Kit Item + * Non-Inventory Purchase Item + * Non Inventory Resale Item + * Non Inventory Sale Item + * Other Charge Purchase Item + * Other Charge Resale Item + * Other Charge Sale Item + * Payment Item + * Service Resale Item + Service Sale Item +* **Allow Empty Results (Defaults: false)** - When an item not found, if this is checked, an empty object will be emitted instead of throwing an error. + +### Get Item Availability. Input Metadata +* **Item Internal ID** - internal ID of an item to search by. Optional +* **Item External ID** - external ID of an item to search by. Optional. +Please note that either 'External ID' or 'Internal ID' field must be provided. + +Input metadata example: +```json +{ + "internalId": "1234" +} +``` + +### Get Item Availability. Output Metadata +Generates dynamically based on the item type selected in the configuration field + +## Lookup Object By Id + +Lookup an object by the ID provided. + +![Lookup Object By Id](img/lookup-by-id.png) + +### Configuration Fields + +* **Object Category** - a category of an object in NetSuite + * Standard + * Custom +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. +* **Allow ID to be omitted** +* **Allow Zero Results** + +## Lookup Objects + +Looks for objects available in NetSuite which meet given criteria. + +![Lookup Objects](img/lookup-objects.png) + +Use this action to execute the following types of searches: + +* [**Basic search**](#basic-search) — Execute a search on a record type based on search filter fields that are specific to that type. See Basic Searches in SOAP Web Services. + +* [**Joined search**](#joined-search) — Execute a search on a record type based on search filter fields on an associated record type. See Joined Searches in SOAP Web Services + +* [**Advanced search**](#advanced-search) — Execute a search on a record type in which you specify search filter fields and/or search return columns or joined search columns. Using advanced search, you can also return an existing saved search. See Advanced Searches in SOAP Web Services. + +### Config fields + +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. + +* **Search Type** - a type of search. See below. + * Basic + * Joined + * Advanced + +* **Behavior** - a behavior for the component on how to handle the response which has more than 1 object to response with: + * Emit individually + * Fetch all + * Fetch Page + +### Basic search + +A basic search lets you search records of a specific type using the fields on that record as search filters. +In a basic search, field criteria are the only values you set. You cannot specify search return columns. +The full list of available objects to search can be found in the Help Center (may vary for each installation). You can find the entire metadata of each object there as well. + +Log in to your NetSuite account > Suite Cloud (Customization, Scripting, and Web Services) > SuiteCloud Platform Introduction > SuiteCloud Records Reference Tools > The SuiteScript Records Browser > Click 'Go to the SuiteScript Records Browser.' + +![SuiteScript Records Browser](https://user-images.githubusercontent.com/8449044/61944948-8490eb80-afa7-11e9-9272-60f63a387ebc.png) + +Then choose Schema Browser > 'common' from the dropdown list and open the `Search` tab at the left. + +![Common](https://user-images.githubusercontent.com/8449044/61945260-34feef80-afa8-11e9-8026-8e995dcff3d1.png) + +What you should do next is to build a correct search request using object fields and operators. + +#### Search operators + +It is just the recommended list. You should always use an actual one based on the Help center of your account. + +
GetSelectValueFilterOperator: + +* contains +* is +* startsWith + +
+ +
SearchDateFieldOperator: + +* after +* before +* empty +* notAfter +* notBefore +* notEmpty +* notOn +* notOnOrAfter +* notOnOrBefore +* notWithin +* on +* onOrAfter +* onOrBefore +* within + +
+ +
SearchDoubleFieldOperator: + +* between +* empty +* equalTo +* greaterThan +* greaterThanOrEqualTo +* lessThan +* lessThanOrEqualTo +* notBetween +* notEmpty +* notEqualTo +* notGreaterThan +* notGreaterThanOrEqualTo +* notLessThan +* notLessThanOrEqualTo + +
+ +
SearchEnumMultiSelectFieldOperator: + +* anyOf +* noneOf + +
+ +
SearchLongFieldOperator: + +* between +* empty +* equalTo +* greaterThan +* greaterThanOrEqualTo +* lessThan +* lessThanOrEqualTo +* notBetween +* notEmpty +* notEqualTo +* notGreaterThan +* notGreaterThanOrEqualTo +* notLessThan +* notLessThanOrEqualTo + +
+ +
SearchMultiSelectFieldOperator: + +* anyOf +* noneOf + +
+ +
SearchStringFieldOperator: + +* contains +* doesNotContain +* doesNotStartWith +* empty +* hasKeywords +* is +* isNot +* notEmpty +* startsWith + +
+ +
SearchTextNumberFieldOperator: + +* between +* empty +* equalTo +* greaterThan +* greaterThanOrEqualTo +* lessThan +* lessThanOrEqualTo +* notBetween +* notEmpty +* notEqualTo +* notGreaterThan +* notGreaterThanOrEqualTo +* notLessThan +* notLessThanOrEqualTo + +
+ +#### Basic Search Samples + +##### Search contacts by a provided email + +Object Type: Contact + +Search Type: ContactSearchBasic + +XML request: + +
Click to expand for more details: + +```xml + + + + YOURAPPLICATIONID + + + YOUREMAIL + YOURPASSWORD + YOURACCOUNT + + + + + + + + tomsmith@tomsmith.com + + + + + + +``` + +
+ +The same request for the component (JSON): + +```json +{ + "email": { + "searchValue": "tomsmith@tomsmith.com", + "operator": { + "value": "is" + } + } +} +``` + +Response: + +
Click to expand for more details: + +```json +{ + "results": [ + { + "internalId": "4248", + "lastModifiedDate": "2018-08-17T08:51:19.000+0000", + "dateCreated": "2018-08-17T08:16:53.000+0000", + "globalSubscriptionStatus": { + "value": "_softOptIn" + }, + "subsidiary": { + "internalId": "3", + "name": "Honeycomb Holdings Inc." + }, + "isInactive": false, + "isPrivate": false, + "email": "tomsmith@tomsmith.com", + "lastName": "Smith", + "firstName": "Tom", + "salutation": "Smith", + "entityId": "Tom Smith" + } + ] +} +``` + +
+ +### Joined search + +Execute a search on a record type based on search filter fields on an associated record type. +A joined search allows you search against a specific record type using the fields on an associated record as search filters. +In the NetSuite UI, you can identify which associated records provide joined filter criteria by first navigating to a record's search interface. + +Once again, you can find the list of available objects in the Help Center. The component will dynamically fetch all the list with an available metadata. But you should always look at the documentation to build a correct search request. + +#### Joined Search Samples + +##### Search contacts associated with customers + +Object Type: Contact + +Search Type: Contact Search Join + +The following sample shows how to return an associated joined list of records. In this case, all contacts associated with customers of internalId 1, 2 and 3 are returned. + +XML request: + +
Click to expand for more details: + +```xml + + + + YOURAPPLICATIONID + + + YOUREMAIL + YOURPASSWORD + YOURACCOUNT + + + + + + + + + + + + + + + + +``` + +
+ +The same request for the component (JSON): + +```json +{ + "customerJoin": { + "internalId": { + "searchValue": [ + { + "internalId": "449", + "name": "customer" + }, + { + "internalId": "500", + "name": "customer" + }, + { + "name": "customer", + "internalId": "594" + } + ], + "operator": { + "value": "anyOf" + } + } + } +} +``` + +Response: + +
Click to expand for more details: + +```json +{ + "results": [ + { + "externalId": "Karen Austin / John Spear", + "internalId": "912", + "lastModifiedDate": "2019-07-24T09:54:53.000+0000", + "dateCreated": "2015-06-07T20:47:55.000+0000", + "globalSubscriptionStatus": { + "value": "_softOptIn" + }, + "supervisor": { + "internalId": "27", + "name": "Brad M Sparling" + }, + "mobilePhone": "(123) 545-6666", + "homePhone": "(222) 123-4321", + "officePhone": "(123) 456-7890", + "subsidiary": { + "internalId": "1", + "name": "Honeycomb Mfg." + }, + "isInactive": false, + "isPrivate": false, + "defaultAddress": "Brandy Dough
7829 N. Commerce Avenue
San Francisco CA
United States", + "email": "bdickens@ramsey.com", + "phone": "(123) 456-7890", + "title": "Purchasing", + "lastName": "Dickens", + "firstName": "Brandy", + "entityId": "Brandy Dickens" + }, + { + "internalId": "1545", + "lastModifiedDate": "2019-07-24T09:56:22.000+0000", + "dateCreated": "2015-03-18T14:35:42.000+0000", + "globalSubscriptionStatus": { + "value": "_softOptIn" + }, + "supervisor": { + "internalId": "1516", + "name": "Brenda Jones" + }, + "homePhone": "(713) 456-7878", + "subsidiary": { + "internalId": "1", + "name": "Honeycomb Mfg." + }, + "isInactive": false, + "isPrivate": false, + "defaultAddress": "123
Ave B
Houston TX 78665
United States", + "email": "adminaccess2@ramsey.com", + "phone": "(713) 456-7878", + "lastName": "Samms", + "firstName": "Brandy", + "entityId": "Brandy Samms" + } + ] +} +``` + +
+ +##### Search items with a price equal to 10 + +Object Type: Item + +Search Type: Item Search Join + +The following sample shows how to search for all items that have a price level of 10.00. + +XML request: + +
Click to expand for more details: + +```xml + + + + YOURAPPLICATIONID + + + YOUREMAIL + YOURPASSWORD + YOURACCOUNT + + + + + + + + _inventoryItem + + + + + 10 + + + + + + +``` + +
+ +The same request for the component (JSON): + +```json +{ + "pricingJoin": { + "rate": { + "operator": { + "value": "equalTo" + }, + "searchValue": 10 + } + }, + "basic": { + "type": { + "operator": { + "value": "anyOf" + }, + "searchValue": [ + "_inventoryItem" + ] + } + } +} +``` + +Response + +
Click to expand for more details: + +```json +{ + "results": [ + { + "externalId": "ITEM163", + "internalId": "163", + "customFieldList": { + "customField": [ + { + "value": false, + "scriptId": "custitem16", + "internalId": "194" + } + ] + }, + "supplyReplenishmentMethod": { + "internalId": "REORDER_POINT", + "name": "Reorder Point" + }, + "currency": "USA", + "availableToPartners": false, + "isInactive": true, + "offerSupport": false, + "isOnline": true, + "displayName": "Reserve Pinot Noir 2000", + "itemId": "Reserve Pinot Noir 2000", + "outOfStockBehavior": { + "value": "_default" + }, + "onSpecial": false, + "dontShowPrice": false, + "showDefaultDonationAmount": false, + "isDonationItem": false, + "sitemapPriority": { + "value": "_auto" + }, + "excludeFromSitemap": false, + "autoReorderPoint": true, + "seasonalDemand": false, + "autoPreferredStockLevel": true, + "autoLeadTime": true, + "leadTime": 0, + "useBins": false, + "cost": 6, + "overallQuantityPricingType": { + "value": "_byLineQuantity" + }, + "costEstimateType": { + "value": "_averageCost" + }, + "useMarginalRates": false, + "costCategory": { + "internalId": "3", + "name": "Default" + }, + "shipIndividually": false, + "enforceMinQtyInternally": true, + "roundUpAsComponent": false, + "isSpecialOrderItem": false, + "isDropShipItem": false, + "trackLandedCost": false, + "costingMethodDisplay": "Average", + "weightUnit": { + "value": "_lb" + }, + "weight": 5, + "billExchRateVarianceAcct": { + "internalId": "152", + "name": "5097 Bill Exchange Rate Variance" + }, + "billPriceVarianceAcct": { + "internalId": "151", + "name": "5096 Bill Price Variance" + }, + "billQtyVarianceAcct": { + "internalId": "150", + "name": "5095 Bill Quantity Variance" + }, + "matchBillToReceipt": false, + "assetAccount": { + "internalId": "120", + "name": "Inventory Asset" + }, + "taxSchedule": { + "internalId": "1", + "name": "S1" + }, + "incomeAccount": { + "internalId": "56", + "name": "4002 Sales : Sales - Merchandise" + }, + "includeChildren": true, + "salesDescription": "Reserve Pinot Noir 2000", + "cogsAccount": { + "internalId": "121", + "name": "Cost of Goods Sold" + }, + "copyDescription": false, + "purchaseDescription": "Reserve Pinot Noir 2000", + "lastModifiedDate": "2016-01-18T08:05:19.000+0000", + "createdDate": "2015-06-12T21:29:35.000+0000" + }, + { + "externalId": "ITEM164", + "internalId": "164", + "customFieldList": { + "customField": [ + { + "value": false, + "scriptId": "custitem16", + "internalId": "194" + } + ] + }, + "supplyReplenishmentMethod": { + "internalId": "REORDER_POINT", + "name": "Reorder Point" + }, + "currency": "USA", + "availableToPartners": false, + "isInactive": true, + "offerSupport": false, + "isOnline": true, + "displayName": "Crystallus 2002", + "itemId": "Crystallus 2002", + "outOfStockBehavior": { + "value": "_default" + }, + "onSpecial": false, + "dontShowPrice": false, + "showDefaultDonationAmount": false, + "isDonationItem": false, + "sitemapPriority": { + "value": "_auto" + }, + "excludeFromSitemap": false, + "autoReorderPoint": true, + "seasonalDemand": false, + "autoPreferredStockLevel": true, + "autoLeadTime": true, + "leadTime": 0, + "useBins": false, + "cost": 5, + "overallQuantityPricingType": { + "value": "_byLineQuantity" + }, + "costEstimateType": { + "value": "_averageCost" + }, + "useMarginalRates": false, + "costCategory": { + "internalId": "3", + "name": "Default" + }, + "shipIndividually": false, + "enforceMinQtyInternally": true, + "roundUpAsComponent": false, + "isSpecialOrderItem": false, + "isDropShipItem": false, + "trackLandedCost": false, + "costingMethodDisplay": "Average", + "weightUnit": { + "value": "_lb" + }, + "weight": 5, + "billExchRateVarianceAcct": { + "internalId": "152", + "name": "5097 Bill Exchange Rate Variance" + }, + "billPriceVarianceAcct": { + "internalId": "151", + "name": "5096 Bill Price Variance" + }, + "billQtyVarianceAcct": { + "internalId": "150", + "name": "5095 Bill Quantity Variance" + }, + "matchBillToReceipt": false, + "assetAccount": { + "internalId": "120", + "name": "Inventory Asset" + }, + "taxSchedule": { + "internalId": "1", + "name": "S1" + }, + "incomeAccount": { + "internalId": "56", + "name": "4002 Sales : Sales - Merchandise" + }, + "includeChildren": true, + "salesDescription": "Crystallus 2002", + "cogsAccount": { + "internalId": "121", + "name": "Cost of Goods Sold" + }, + "copyDescription": false, + "purchaseDescription": "Crystallus 2002", + "lastModifiedDate": "2016-01-18T08:05:19.000+0000", + "createdDate": "2015-06-12T21:29:35.000+0000" + } + ] +} +``` + +
+ +### Advanced search + +Execute a search on a record type in which you specify search filter fields and/or search return columns or joined search columns. +Using advanced search, you can also return an existing saved search. + +Advanced searching provides users with the ability to: + +* Perform a search that references an existing saved search +* Perform a search that references an existing saved search, and then overrides existing search return columns with new search return columns +* Perform a search that references an existing saved search, and then provides additional search filter criteria (on top of the criteria already specified in the saved search) +* Perform a search that specifies search criteria and search result columns + +The SOAP web services API includes advanced search objects for all records that have an existing search interface. + +> **Please check** your 'Advanced Search' Help center section in order to build a correct request. You can find it in the following way: + +Log in to your NetSuite account > Suite Cloud (Customization, Scripting, and Web Services) > SuiteTalk Web Services > SuiteTalk SOAP Web Services Platform Guide > SOAP Web Services operations > search > Advanced Searches in SOAP Web Services. + +The component will always fetch all the existing metadata for the advanced search for you. All you should do is to delete what you don't need and to build a correct request based on the documentation. + +#### Known Limitations + + - Enum values for condition operators accessible only in the `Basic search` type. + - Input metadata for property columns absent for object type: `Transaction` and `Advance Search` search type. + - The following transaction searches are not supported: + +
Click to expand for more details: + + - Blanket Purchase Order + - CCard Refund + - Commission + - Credit Card + - Currency Revaluation + - Customer Payment Authorization + - Deprecated Custom Transaction + - Finance Charge + - Fulfillment Request + - GL Impact Adjustment + - Inventory Count + - Inventory Distribution + - Inventory Status Change + - Inventory Worksheet + - Liability Adjustment + - Ownership Transfer + - Payroll Adjustment + - Payroll Liability Check + - Period End Journal + - Purchase Contract + - Request For Quote + - Revenue Arrangement + - Revenue Commitment + - Revenue Commitment Reversal + - Revenue Contract + - Sales Tax Payment + - Statement Charge + - Store Pickup Fulfillment + - System Journal + - Tax Liability Cheque + - Tegata Payable + - Tegata Receivable + - Transfer + - Vendor Request For Quote + +
+ +#### Advanced Search Samples + +##### Execute saved search + +Object Type: Customer + +Search Type: Customer Search Advanced + +The following sample shows how to find customers, using saved search (by a keyword in an email). + +XML request: + +
Click to expand for more details: + +```xml + + + + YOURAPPLICATIONID + + + YOUREMAIL + YOURPASSWORD + YOURACCOUNT + + + + + + + + +``` + +
+ +The same request for the component (JSON): + +```json +{ + "savedSearchId": "740" +} +``` + +Response: + +
Click to expand for more details: + +```json +{ + "results": [ + { + "basic": { + "salesRep": [ + { + "searchValue": { + "internalId": "1008" + } + } + ], + "phone": [ + { + "searchValue": "937-287-2222" + } + ], + "internalId": [ + { + "searchValue": { + "internalId": "980" + } + } + ], + "entityId": [ + { + "searchValue": "D&H Manufacturing" + } + ], + "billState": [ + { + "searchValue": "OH" + } + ], + "billCity": [ + { + "searchValue": "Dayton" + } + ], + "billAddress1": [ + { + "searchValue": "410 E. Fifth St." + } + ] + } + } + ] +} +``` +
+ +## Upsert Object By Id + +Either update an object in NetSuite by an ID provided or inserts as a new object if it does not exist. + +![Upsert Object By Id](img/upsert-object-by-id.png) + +### Upsert Object By Id. Config Fields + +* **Object Category** - a category of an object in NetSuite + * Standard + * Custom +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. + +## Upsert Custom Fields + +Currently, You can upsert custom fields only from developer mode. +You should to use property **type**, which can accept next values: + + - BooleanCustomFieldRef + - DateCustomFieldRef + - DoubleCustomFieldRef + - LongCustomFieldRef + - MultiSelectCustomFieldRef + - SelectCustomFieldRef + - StringCustomFieldRef + + You can find example of custom field structures [here](/components/netsuite/index#upsert-custom-fields). + +## Lookup Objects By Custom Field + +Looks for objects available in NetSuite which meet given custom string field criteria. + +### Configuration Fields + +* **Object Category** - a category of an object in NetSuite + * Standard + * Custom +* **Object Type** - an object in NetSuite (Contact, Customer, Invoice, Cash Sale etc.). Fetches dynamically. + +Input metadata objects: + +* Custom field name - name of the custom field. E.g. `custbody_tran_number` +* Custom field value - value of the custom field. E.g. `ABC-123` + +```json +{ + "customFieldName": "custbody_tran_number", + "customFieldValue": "ABC-123" +} +``` + +## Update Object + +Update an object in NetSuite. + +### Configuration Fields + +* **Object Category** - a category of an object in NetSuite + * Standard + * Custom +* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. + +### Input Metadata + +Is being fetched dynamically. Sample: + +
Input metadata for Invoice object: + +```json +{ + "internalId": "13817", + "entity": { + "internalId": "5" + }, + "currency": { + "internalId": "1" + }, + "tranDate": "2023-05-23", + "itemList": { + "item": [ + { + "description": "General Donation", + "amount": 1000, + "item": { + "internalId": "12" + }, + "quantity": 1, + "rate": "100", + "taxCode": { + "internalId": "5" + }, + "customFieldList": { + "customField": [ + { + "type": "SelectCustomFieldRef", + "scriptId": "asd_d3", + "value": { + "name": "Charity type", + "internalId": "2" + } + } + ] + } + } + ] + }, + "customFieldList": { + "customField": [ + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-one", + "value": "Bank Transfer" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-two", + "value": "Individual One-Off" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-three", + "value": "John Doe" + }, + { + "type": "StringCustomFieldRef", + "scriptId": "custbody_sf_field-four", + "value": "ABC-987" + } + ] + } +} +``` +
\ No newline at end of file diff --git a/content/_components/netsuite/authentication.md b/content/_components/netsuite/authentication.md new file mode 100644 index 00000000..2e6c6126 --- /dev/null +++ b/content/_components/netsuite/authentication.md @@ -0,0 +1,73 @@ +--- +title: NetSuite Authentication +layout: component +description: Information on NetSuite component authentication on the platform +icon: netsuite.png +icontext: NetSuite component +category: netsuite +updatedDate: 2023-05-26 +ComponentVersion: 3.1.0 +--- + +## API version + +**2022.1** NetSuite version is used and supported. The component will work with other NS versions in most cases. But 100% compatibility could not be guaranteed. + +## Requirements + +### Environment variables +Environment variable `EIO_REQUIRED_RAM_MB` must be configured before any component's activity (credentials verify, retrieve sample). + +| Variable | Value | +| :------------ | :---------- | +| EIO_REQUIRED_RAM_MB | 1024 | + +### Enable web-service communication +NetSuite’s Web Services SOAP interface allows you to communicate with the ERP and to integrate external systems with it. NetSuite's native SDK, which is used for the communication in the component, uses NetSuite’s SOAP Web Services under the hood. By default web service communication is disabled in NetSuite. So it should be enabled in order to allow component make calls. To enable Web Service communication: + +1. Go to Setup -> Company -> Enable Features. +2. Open SuiteCloud tab and tick there the 'Web Services' checkbox in the SuitTalk section. +3. Press Save. + +![Enable web-service communication](img/enable-web-service-communication.png) + +## Credentials + +Netsuite connector since version 3.0.0 only supports a token based authentication mechanisms. Support of a user credentials mechanism has been removed by Netsuite SOAP API. + +To use Token-Based authentication you must at first setup a Netsuite account: Enable Integration: + +1. Go to **Setup** > **Company** > **Enable Features** > **Suite Cloud** > **Manage Authentication**. +2. Enable Token-Based Authentication. +3. Go to menu **Setup** > **Integrations** > **Manage Integrations**. +4. Click **New** button. +5. Set the name to whatever you want. Please make sure to tick the Token-Based Authentication option, uncheck the `TBA: AUTHORIZATION FLOW` and `AUTHORIZATION CODE GRANT` option, and check the `TBA: ISSUETOKEN ENDPOINT` option. +6. Copy Consumer Key and Consumer secret values to be used in credentials. As they will be not available later. + +### Create a Role and assign to a User: + +1. Go to **Setup** > **Users/Roles** > **Manage Roles** > **New**. +2. Create a role and assign necessary permissions for a connector (Access to any Netsuite object types, transactions, etc.). +3. The role must have `User Access Tokens` and `SOAP Web Services` permissions for integration using TBA +4. Assign the Role to the desired user that will be used for integration. Go to **Lists** > **Employees** > **Edit user** > **Access tab** > **Roles subtab**. + +### Create an Access Token for the Integration record, User, and Role: + +1. Go to **Setup** > **Users/Roles** > **Access Tokens** > **New**. +2. Select the Integration record, User, and Role created or referenced in the previous steps. +3. Token Id and Token Secret will be displayed after tapping the save button. Copy the Consumer Key and Consumer secret values as they as will not be available after you leave the page. + +All the credentials fields are required: + +1. **Domain**. To find your domain endpoint go to **Setup** > **Company** > **Setup Tasks > **Company Information** (Administrator) in the NetSuite UI. Your domains are listed on the Company URL's subtab. Should be something like `https://{accountId}.suitetalk.api.netsuite.com`. +2. **Account**. Account Number to access NetSuite API. This number is required for the component to connect to NetSuite via native SuiteTalk API. Can be found here: + 1. Go to **Setup** -> **Integration** -> **Web Services Preferences**. + 2. Find `ACCOUNT ID` field there. + ![Account id location](img/account_id_location.png) + +> **Important!** Make sure you have copied an account name exactly how it is specified in Netsuite UI. + +3. **Consumer Key**. +4. **Consumer Secret**. +5. **Token Id**. +6. **Token Secret**. diff --git a/content/_components/netsuite/deprecated-functions.md b/content/_components/netsuite/deprecated-functions.md new file mode 100644 index 00000000..968ba563 --- /dev/null +++ b/content/_components/netsuite/deprecated-functions.md @@ -0,0 +1,352 @@ +--- +title: Deprecated NetSuite functions +layout: component +description: Information on deprecated NetSuite functions +icon: netsuite.png +icontext: NetSuite component +category: netsuite +updatedDate: 2023-05-26 +ComponentVersion: 3.1.0 +--- + +## Deprecated Triggers + +### Search Entity(deprecated) + +Deprecated. Use [Get New and Updated Objects Polling](/components/netsuite/triggers#get-new-and-updated-objects-polling) trigger instead. + +Find an object or a set of objects using filter criteria (field, operator, value). + +### How to use Search Entity Trigger + +#### Step 1 + +Find and select NetSuite component in the component repository + +![Step 1](https://user-images.githubusercontent.com/16806832/44349305-75efa980-a4a5-11e8-8cd3-a9529ffd9625.png) + +#### Step 2 + +Create new or select existing credentials + +![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) + +#### Step 3 + +Specify parameters for searching entity +The component supports next entity types for now: + - Customer payments + - Vendor payments + + Supported entity list can be extended in future. + +![Step 3](https://user-images.githubusercontent.com/16806832/44348950-8d7a6280-a4a4-11e8-8201-2a1610dab8f0.png) + +##### Step 3.1 + +Select "Entity type" from drop-down list, you can choose "Vendor payment" or "Customer payment" + +![Step 3.1](https://user-images.githubusercontent.com/16806832/44349277-5a849e80-a4a5-11e8-908f-820812e826ad.png) + +##### Step 3.2 + +Select options "Filter by field" from drop-down list, you can choose "dateCreated" or "lastModifiedDate" + +![Step 3.2](https://user-images.githubusercontent.com/16806832/44349548-f1e9f180-a4a5-11e8-804b-5d35bf8871db.png) + +##### Step 3.3 + +Select options "Filter operator" from drop-down list, you can choose next one: + + - after + - before + - notAfter + - notBefore + - notEmpty + - on + - notOn + - notOnOrBefore + - notOnOrAfter + - onOrAfter + - onOrBefore + +![Step 3.3](https://user-images.githubusercontent.com/16806832/44349714-51480180-a4a6-11e8-8b6f-dbb7e0aeed7b.png) + +##### Step 3.4 + +Input "Filter value" - date and time in format "2018-01-01T00:00:00.000 -07:00" +At the end of trigger execution "Filter value" field change value to "Last trigger execution date" value. +It is opportunity to load only new updated/created records from the NetSuite. + +![Step 3.4](https://user-images.githubusercontent.com/16806832/44350141-4cd01880-a4a7-11e8-88b9-9e002276458c.png) + +#### Step 4 + +Retrieve sample or add sample manually + +![Step 4: Retrieve sample](https://user-images.githubusercontent.com/16806832/44350423-07601b00-a4a8-11e8-933d-3617971eb0fc.png) + +#### Step 5 + +Retrieve sample result + +![Step 5: Retrieve sample result](https://user-images.githubusercontent.com/16806832/44350359-d849a980-a4a7-11e8-9f78-57023a0c2dfa.png) + +## Deprecated Action + +### Lookup Customer(deprecated) + +Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead. + +This action enables to find the customer by provided ID. It is possible to provide +**internal**, **external** id or **all** of them in input message. + +If entity doesn't have `externalId` You must specify only `internalId` in +input message. If You specify incorrect internal or external id, You will get +error **That record does not exist.** + +For example when the `externalId` exists the answer would be: + +```javascript +{ + "internalId":"1234", + "externalId":"4567" +} +``` + +When the `externalId` does not exist: + +```javascript +{ + "internalId":"1234" +} +``` + +### Lookup Invoice(deprecated) + +Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead. + +This action can be used to find invoices by provided ID. + +You can provide **internal**, **external** id or **all** of them in input message. +If entity doesn't have `externalId` You must specify only `internalId` in input message. + +If You specify incorrect internal or external id, You will get error "**That record does not exist.**" + +For example if the `externalId` exists: + +```javascript +{ + "internalId":"1234", + "externalId":"4567" +} +``` + +If the `externalId` does not exist: + +```javascript +{ + "internalId":"1234" +} +``` + +### Upsert Customer(deprecated) + +Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead + +Create new or update existing customer by provided external ID. The request +sample could look like: + +```javascript +{ + "externalId": "external order ID", + "customerId": "internal customer ID", + "currency": "USA", + "exchangeRate": 1.0, + "orderItems": [ + { + "itemInternalId": "387", + "quantity": 10![Step 1](https://some-url-address) + + } + ] +} +``` + +### Upsert Contact(deprecated) + +Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. + +Create new or update existing contact by provided external ID. + +Request sample: +```javascript +{ + "externalId": "entity164", + "customForm": { + "internalId": "-40", + "name": "Standard Contact Form" + }, + "entityId": "Olha Grogan", + "salutation": "Mrs.", + "firstName": "Olha", + "lastName": "Grogan", + "subsidiary": { + "internalId": "1", + "name": "Honeycomb Mfg." + } +} +``` + +### Upsert Invoice(deprecated) + +Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. + +Create new or update existing invoice by provided external ID. + +Request sample: +```javascript +{ + "externalId": "23213000001", + "customForm": { + "name": "HM Product Invoice", + "internalId": "102" + }, + "entity": { + "name": "Jennings Financial", + "internalId": "81" + }, + "terms": { + "name": "Net 30", + "internalId": "2" + }, + "subsidiary": { + "name": "Honeycomb Mfg.", + "internalId": "1" + }, + "currency": { + "name": "USA", + "internalId": "1" + }, + "location": { + "name": "02: Boston", + "internalId": "1" + }, + "isTaxable": true, + "taxItem": { + "name": "CA-SAN MATEO", + "internalId": "-112" + }, + "taxRate": 8.25, + "fax": "916-555-0806", + "message": "We appreciate your prompt payment", + "shipMethod": { + "name": "Truck", + "internalId": "3" + }, + "itemList": { + "item": [ + { + "job": null, + "item": { + "name": "CHA00002®", + "internalId": "707", + "externalId": null, + "type": null + }, + "line": 1, + "description": "Assembly Item - Historical", + "amount": 7020, + "isTaxable": null, + "quantity": 36, + "price": { + "name": "List Price", + "internalId": "1" + }, + "rate": "195.00", + "taxCode": { + "name": "-Not Taxable-", + "internalId": "-7" + } + } + ], + "replaceAll": false + }, + "shippingCost": 704.25, + "customFieldList": { + "customField": [ + { + "type": "BooleanCustomFieldRef", + "internalId": "167", + "scriptId": "custbody_fmt_senior_exec_declined", + "value": false + } + ] + } +} +``` + +### Upsert Sales Order(deprecated) + +Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. + +Create new or update existing sales order by provided external ID. + +Request sample: + +```javascript +{ + "externalId": "80144000000B5wqAAC", + "orderStatus": "_pendingFulfillment", + "currency": { + "name": "USA", + "internalId": "1" + }, + "customForm": { + "internalId": "174", + "name": "Z - HM Sales Order Form" + }, + "entity": { + "internalId": "2053" + }, + "exchangeRate": "1.0", + "toBePrinted":"false" +} +``` + +### Upsert Vendor(deprecated) + +Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. + +Create new or update existing vendor by provided external ID. + +Request sample: + +```javascript +{ + "externalId": "9999", + "entityId": "Nick", + "isPerson": "false", + "companyName": "Nick2", + "phone": "937 99 92", + "fax": "937 99 92", + "email": "nick2@nickthebest.com", + "url": "http://www.nickthebest2.com", + "customFieldList": { + "customField": [ + { + "internalId": "3992", + "scriptId": "custentity_2663_payment_method", + "type": "BooleanCustomFieldRef", + "value": "false" + }, + { + "internalId": "3993", + "scriptId": "custentity_2663_payment_method", + "type": "BooleanCustomFieldRef", + "value": "false" + } + ] + } +} +``` diff --git a/content/_components/netsuite/index.md b/content/_components/netsuite/index.md index 3d0aa632..a914e9dd 100644 --- a/content/_components/netsuite/index.md +++ b/content/_components/netsuite/index.md @@ -10,1792 +10,129 @@ updatedDate: 2024-09-04 ComponentVersion: 3.2.0 --- -# NetSuite component +## How it works -## Table of Contents -* [General information](#general-information) - * [Description](#description) - * [Purpose](#purpose) - * [How works](#how-works) - * [API version](#api-version) -* [Requirements](#requirements) - * [Environment variables](#environment-variables) - * [Enable web-service communication](#enable-web-service-communication) -* [Credentials](#credentials) - * [Get credentials in NetSuite](#get-credentials-in-netsuite) - * [Authentication on elastic.io](#authentication-on-elasticio) -* [Triggers](#triggers) - * [Get New and Updated Objects Polling](#get-new-and-updated-objects-polling) - * [Get New and Updated Objects Polling. Config fields](#get-new-and-updated-objects-polling-config-fields) - * [Search Entity (deprecated)](#search-entity-deprecated) - * [How to use Search Entity Trigger](#how-to-use-search-entity-trigger) -* [Actions](#actions) - * [Add Object](#add-object) - * [Add Object. Config fields](#add-object-config-fields) - * [Add Object. Input metadata](#add-object-input-metadata) - * [Delete Object By Id](#delete-object-by-id) - * [Delete Object By Id. Config fields](#delete-object-by-id-config-fields) - * [Get Item Availability](#get-item-availability) - * [Lookup Object By Id](#lookup-object-by-id) - * [Delete Object By Id. Config fields](#lookup-object-by-id-config-fields) - * [Lookup Objects](#lookup-objects) - * [Lookup Objects. Config fields](#lookup-objects-config-fields) - * [Basic search](#basic-search) - * [Search operators](#search-operators) - * [Basic Search Samples](#basic-search-samples) - * [Joined search](#joined-search) - * [Joined Search Samples](#joined-search-samples) - * [Advanced search](#advanced-search) - * [Advanced Search Samples](#advanced-search-samples) - * [Lookup Objects By Custom Field](#lookup-objects-by-custom-field) - * [Lookup Objects By Custom Field. Config fields](#lookup-objects-by-custom-field-config-fields) - * [Update Object](#update-object) - * [Update Object. Config fields](#update-object-config-fields) - * [Update Object. Input metadata](#update-object-input-metadata) - * [Upsert Object By Id](#upsert-object-by-id) - * [Upsert Object By Id. Config fields](#upsert-object-by-id-config-fields) - * [Lookup Customer (deprecated)](#lookup-customer-deprecated) - * [How to use Lookup Customer Action](#how-to-use-lookup-customer-action) - * [Lookup Customer. Input metadata](#lookup-customer-input-metadata) - * [Lookup Invoice (deprecated)](#lookup-invoice-deprecated) - * [How to use Lookup Invoice Action](#how-to-use-lookup-invoice-action) - * [Lookup Invoice. Input metadata](#lookup-invoice-input-metadata) - * [Upsert Contact (deprecated)](#upsert-contact-deprecated) - * [How to use Upsert Contact Action](#how-to-use-upsert-contact-action) - * [Upsert Contact. Input metadata](#upsert-contact-input-metadata) - * [Upsert Customer (deprecated)](#upsert-customer-deprecated) - * [How to use Upsert Customer Action](#how-to-use-upsert-customer-action) - * [Upsert Customer. Input metadata](#upsert-customer-input-metadata) - * [Upsert Invoice (deprecated)](#upsert-invoice-deprecated) - * [How to use Upsert Invoice Action](#how-to-use-upsert-invoice-action) - * [Upsert Invoice. Input metadata](#upsert-invoice-input-metadata) - * [Upsert Sales Order (deprecated)](#upsert-invoice-deprecated) - * [How to use Upsert Sales Order Action](#how-to-use-upsert-sales-order-action) - * [Upsert Sales Order. Input metadata](#upsert-sales-order-input-metadata) - * [Upsert Vendor (deprecated)](#upsert-invoice-deprecated) - * [How to use Upsert Vendor Action](#how-to-use-upsert-vendor-action) - * [Upsert Vendor. Input metadata](#upsert-vendor-input-metadata) - * [Upsert Custom Fields](#upsert-custom-fields) -* [Known Limitations](#known-limitations) -* [Links](#links) - - -## General information -### Description -[elastic.io](http://www.elastic.io;) iPaaS component that connects to NetSuite ERP API. -### Purpose -Main purpose of this component is to provide functionality to interact with NetSuite ERP system. -### How works Communication with NetSuite API established using NetSuite's native SDK. -### API version -**2022.1** NetSuite version is used and supported. The component will work with other NS versions in most cases. But 100% compatibility could not be guaranteed. - -### Requirements -#### Environment variables -Environment variable 'EIO_REQUIRED_RAM_MB' must be configured **before** any component's activity (credentials verify, retrieve sample). -| Variable | Value | -| ------------------- |:------:| -| EIO_REQUIRED_RAM_MB | 1024 | +## Requirements -#### Enable web-service communication -NetSuite’s Web Services SOAP interface allows you to communicate with the ERP and to integrate external systems with it. -NetSuite's native SDK, which is used for the communication in the component, uses NetSuite’s SOAP Web Services under the hood. -By default web service communication is disabled in NetSuite. -So it should be enabled in order to allow component make calls. -To enable Web Service communication: -1. Go to Setup -> Company -> Enable Features -2. Open SuiteCloud tab and tick there the 'Web Services' checkbox in the SuitTalk section -3. Press Save +### API version -![Enable Web Service](https://user-images.githubusercontent.com/8449044/44262942-9a3d5300-a225-11e8-840d-834528f68776.png) +**2022.1** NetSuite version is used and supported. The component will work with other NS versions in most cases. But 100% compatibility could not be guaranteed. -## Credentials +### Environment variables -Elastic.io Netsuite connector since version 3.0.0 only supports a token based authentication mechanisms. Support of a user credentials mechanism has been removed by Netsuite SOAP API. +Component requires 1024 MB of RAM memory to properly function. It is recommended +to increase the RAM memory prior any activity. Contact Support for more. -To use Token-Based authentication you must at first setup a Netsuite account: -Enable Integration: -1. Go to Setup > Company > Enable Features > Suite Cloud > Manage Authentication -2. Enable Token-Based Authentication -3. Go to menu Setup > Integrations > Manage Integrations -4. Click New button -5. Set the name to whatever you want. Please make sure to tick the Token-Based Authentication option, uncheck the "TBA: AUTHORIZATION FLOW" and "AUTHORIZATION CODE GRANT" option, and check the "TBA: ISSUETOKEN ENDPOINT" option. -6. Copy Consumer Key and Consumer secret values to be used in credentials. As they will be not available later. +### Enable web-service communication +NetSuite’s Web Services SOAP interface allows you to communicate with the ERP +and to integrate external systems with it. NetSuite's native SDK, which is used +for the communication in the component, uses NetSuite’s SOAP Web Services under +the hood. -Create a Role and assign to a User: -1. Go to Setup > Users/Roles > Manage Roles > New -2. Create a role and assign necessary permissions for a connector (Access to any Netsuite object types, transactions, etc.). -3. The role must have "User Access Tokens" and "SOAP Web Services" permissions for integration using TBA -4. Assign the Role to the desired user that will be used for integration. Go to Lists > Employees > edit user > Access tab > Roles subtab. +By default web service communication is disabled in NetSuite. So it should be +enabled in order to allow component make calls. To enable Web Service communication: +1. Go to Setup -> Company -> Enable Features +2. Open SuiteCloud tab and tick there the 'Web Services' checkbox in the SuitTalk section +3. Press Save -Create an Access Token for the Integration record, User, and Role: -1. Go to Setup > Users/Roles > Access Tokens > New. -2. Select the Integration record, User, and Role created or referenced in the previous steps. -3. Token Id and Token Secret will be displayed after tapping the save button. Copy the Consumer Key and Consumer secret values as they as will not be available after you leave the page. +![Enable Web Service](https://user-images.githubusercontent.com/8449044/44262942-9a3d5300-a225-11e8-840d-834528f68776.png) +### Technical Notes -All the credentials fields are required: -1. Domain. To find your domain endpoint go to `Setup > Company > Setup Tasks > Company Information (Administrator)` in the NetSuite UI. - Your domains are listed on the Company URLs subtab. Should be something like `https://{accountId}.suitetalk.api.netsuite.com` -2. Account. Account Number to access NetSuite API. This number is required for the component to connect to NetSuite via native SuiteTalk API. Can be found here: - 1. Go to `Setup -> Integration -> Web Services Preferences` - 2. Find ACCOUNT ID field there. - ![Get Account Number](https://user-images.githubusercontent.com/8449044/44263739-c3abae00-a228-11e8-8de6-8e6b33c23be3.png) +The [technical notes](technical-notes) page gives some technical details about NetSuite component like [changelog](/components/netsuite/technical-notes#changelog). -**Important!** Make sure you have copied an account name exactly how it is specified in Netsuite UI. +## Authentication on platform -3. Consumer Key -4. Consumer Secret -5. Token Id -6. Token Secret +In order to use the functions of the NetSuite component, you need to go through the authentication process. Please follow the step by steps instruction on this [page](authentication). ## Triggers -### Get New and Updated Objects Polling -Generic trigger that polls NetSuite instance for new and/or updated objects (of any type available in the NetSuite). - -#### Get New and Updated Objects Polling. Config fields -* Object Type (dropdown) -* Start Time (string, optional): Indicates the beginning time to start polling from (defaults to the beginning of time) -* End Time (string, optional): If provided, don’t fetch records modified after this time (defaults to never) -* Size of Polling Page (optional; string). Indicates the size of pages to be fetched. Defaults to 1000. CAN NOT be less then 5. -* Single Page per Interval (dropdown/checkbox: yes/no; default yes). Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page immediately, wait until the next flow start to fetch the next page. - -First, the system reads all the objects of the chosen type and processes it further along with your designed integration flow. -It will also create an initial state of fetched objects, we call it a *snapshot*, in order to have something to compare with after your data is updated. - -After the initial read, any further requests for an update or create new object in NetSuite will be compared to this snapshot and in case any changes are detected they will be passed along with the integration flow as well. - -### Search Entity (deprecated) -Deprecated. Use `Get New and Updated Objects Polling` trigger instead. - -Finds an object or a set of objects using filter criteria (field, operator, value). See below for the details. - -#### How to use Search Entity Trigger -##### Step 1 -Find and select NetSuite component in the component repository - -![Step 1](https://user-images.githubusercontent.com/16806832/44349305-75efa980-a4a5-11e8-8cd3-a9529ffd9625.png) -##### Step 2 -Create new or select existing credentials - -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) -##### Step 3 -Specify parameters for searching entity -The component supports next entity types for now: - - Customer payments - - Vendor payments - - Supported entity list can be extended in future. - -![Step 3](https://user-images.githubusercontent.com/16806832/44348950-8d7a6280-a4a4-11e8-8201-2a1610dab8f0.png) -###### Step 3.1 -Select "Entity type" from drop-down list, you can choose "Vendor payment" or "Customer payment" - -![Step 3.1](https://user-images.githubusercontent.com/16806832/44349277-5a849e80-a4a5-11e8-908f-820812e826ad.png) -###### Step 3.2 -Select options "Filter by field" from drop-down list, you can choose "dateCreated" or "lastModifiedDate" - -![Step 3.2](https://user-images.githubusercontent.com/16806832/44349548-f1e9f180-a4a5-11e8-804b-5d35bf8871db.png) -###### Step 3.3 -Select options "Filter operator" from drop-down list, you can choose next one: - - after - - before - - notAfter - - notBefore - - notEmpty - - on - - notOn - - notOnOrBefore - - notOnOrAfter - - onOrAfter - - onOrBefore - -![Step 3.3](https://user-images.githubusercontent.com/16806832/44349714-51480180-a4a6-11e8-8b6f-dbb7e0aeed7b.png) -###### Step 3.4 -Input "Filter value" - date and time in format "2018-01-01T00:00:00.000 -07:00" -At the end of trigger execution "Filter value" field change value to "Last trigger execution date" value. -It is opportunity to load only new updated/created records from the NetSuite. -![Step 3.4](https://user-images.githubusercontent.com/16806832/44350141-4cd01880-a4a7-11e8-88b9-9e002276458c.png) +NetSuite component includes the following triggers: -##### Step 4 -Retrieve sample or add sample manually + 1. [Get New and Updated Objects Polling](/components/netsuite/triggers#get-new-and-updated-objects-polling) + Generic trigger that polls NetSuite instance for new and/or updated objects (of any type available in the NetSuite). -![Step 4: Retrieve sample](https://user-images.githubusercontent.com/16806832/44350423-07601b00-a4a8-11e8-933d-3617971eb0fc.png) -##### Step 5 -Retrieve sample result + 2. [Polling objects](/components/netsuite/triggers#polling-objects) + Find an object or a set of objects was updated since last polling of time. -![Step 5: Retrieve sample result](https://user-images.githubusercontent.com/16806832/44350359-d849a980-a4a7-11e8-9f78-57023a0c2dfa.png) +The following NetSuite triggers are deprecated: -### Polling objects -Find an object or a set of objects was updated since last polling of time. + 1. [Search Entity(deprecated)](/components/netsuite/deprecated-functions#search-entitydeprecated) + Deprecated. Use [Get New and Updated Objects Polling](/components/netsuite/triggers#get-new-and-updated-objects-polling) trigger instead. Find an object or a set of objects using filter criteria (field, operator, value). -#### Input fields - -**Object Type -** -Object type to poll (only for objects which support lastModifiedDate filtering) - -**Start Time -** -Indicates the beginning time to start polling from (defaults to the beginning of time, in next format yyyy-MM-ddTHH:mm:ss.SSS XXX) - -**End Time -** -If provided, don’t fetch records modified after this time (defaults to never, in next format yyyy-MM-ddTHH:mm:ss.SSS XXX) - -**Size of Polling Page -** -Indicates the size of pages to be fetched. Defaults to 1000. - -**Single Page per Interval -** -Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page immediately, wait until the next flow start to fetch the next page. - -#### Known Limitations -At the moment trigger supports polling of next object types: -- Calendar Event, -- Campaign -- Contact -- Customer -- Employee -- Entity -- Entity Group -- Folder -- Issue -- Item -- Item Demand Plan -- Item Supply Plan -- Job -- Opportunity -- Originating Lead -- Partner -- Phone Call -- Project Task -- Solution -- Support Case -- Task -- Transaction -- Vendor ## Actions -### Add Object -Add an object to NetSuite. - -#### Add Object. Config Fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. - -#### Add Object. Input Metadata -Is being fetched dynamically. Sample: - -
Input metadata for Invoice object: - - -```json -{ - "entity": { - "internalId": "5" - }, - "currency": { - "internalId": "1" - }, - "tranDate": "2023-05-23", - "itemList": { - "item": [ - { - "description": "General Donation", - "amount": 1000, - "item": { - "internalId": "12" - }, - "quantity": 1, - "rate": "100", - "taxCode": { - "internalId": "5" - }, - "customFieldList": { - "customField": [ - { - "type": "SelectCustomFieldRef", - "scriptId": "asd_d3", - "value": { - "name": "Charity type", - "internalId": "2" - } - } - ] - } - } - ] - }, - "customFieldList": { - "customField": [ - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-one", - "value": "Bank Transfer" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-two", - "value": "Individual One-Off" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-three", - "value": "John Doe" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-four", - "value": "ABC-987" - } - ] - } -} -``` -
- -### Delete Object By Id -Deletes an object by the ID provided. - -#### Delete Object By Id. Config fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. - -#### Delete Object By Id. Input Metadata -Is being fetched dynamically. The sample: - -Input metadata for Transaction objects: -```json -{ - "internalId": "string", - "externalId": "string", - "deletionReasonCode": "deleteionReasonCodeString", - "deletionReasonMemo": "deletionReasonMemoString" -} -``` - -Deletion Reason Usage Notes -
Click to expand - -> Note the following about the deletionReason parameter: -> The deletionReason complex type includes two fields: deletionReasonCode and deletionReasonMemo. The deletionReasonCode must identify a deletion reason that is listed at Setup > Accounting > Accounting Lists. If the Use Deletion Reasons feature is enabled and you use the deletionReasonCode to identify a code that does not exist, the request fails with an INVALID_REF_KEY error. -> Deletion reasons can be saved only for transactions. However, in SOAP web services, you must use the deletionReason parameter even when referencing other record types, and even when the Use Deletion Reasons feature is not enabled. For situations where it is not appropriate to identify a deletion reason, pass in a value of null. -> Even when when a deletion reason is required, you can use a value of null. In these cases, the system automatically populates the deletion reason fields with default values. These defaults are: Other for deletionReasonCode and This transaction was deleted by script or web service for deletionReasonMemo. -> The deletionReason complex type is defined in the core XSD. -> For more details about the Use Deletion Reasons feature, see Recording a Reason for Deleting a Transaction. -
- -Input metadata for other objects: -```json -{ - "internalId": "string", - "externalId": "string" -} -``` -#### Delete Object By Id. Output Metadata -```json -{ - "internalId": "string" -} -``` - -### Get Item Availability -Allows to get an item availability based on its type and internal ID provided - -#### Get Item Availability. Config fields -* **Item Type** - item type to search for. One of: - * Assembly Item - * Description Item - * Discount Item - * Download Item - * Inventory Item - * Gift Certificate Item - * Kit Item - * Non-Inventory Purchase Item - * Non Inventory Resale Item - * Non Inventory Sale Item - * Other Charge Purchase Item - * Other Charge Resale Item - * Other Charge Sale Item - * Payment Item - * Service Resale Item - Service Sale Item -* **Allow Empty Results (Defaults: false)** - When an item not found, if this is checked, an empty object will be emitted instead of throwing an error. - -#### Get Item Availability. Input Metadata -* **Item Internal ID** - internal ID of an item to search by. Optional -* **Item External ID** - external ID of an item to search by. Optional. -Please note that either 'External ID' or 'Internal ID' field must be provided. - -Input metadata example: -```json -{ - "internalId": "1234" -} -``` - -#### Get Item Availability. Output Metadata -Generates dynamically based on the item type selected in the configuration field - -### Lookup Object By Id -Lookup an object by the ID provided. - -#### Lookup Object By Id. Config fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. -* **Allow ID to be omitted** -* **Allow Zero Results** - -### Lookup Objects -Looks for objects available in NetSuite which meet given criteria. -Use this action to execute the following types of searches: -* [**Basic search**](#basic-search) — Execute a search on a record type based on search filter fields that are specific to that type. See Basic Searches in SOAP Web Services. -* [**Joined search**](#joined-search) — Execute a search on a record type based on search filter fields on an associated record type. See Joined Searches in SOAP Web Services -* [**Advanced search**](#advanced-search) — Execute a search on a record type in which you specify search filter fields and/or search return columns or joined search columns. Using advanced search, you can also return an existing saved search. See Advanced Searches in SOAP Web Services. - -#### Lookup Objects. Config fields -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. -* **Search Type** - a type of search. See below. - * Basic - * Joined - * Advanced -* **Behavior** - a behavior for the component on how to handle the response which has more than 1 object to response with: - * Emit individually - * Fetch all - * Fetch Page - -#### Basic search -A basic search lets you search records of a specific type using the fields on that record as search filters. -In a basic search, field criteria are the only values you set. You cannot specify search return columns. -The full list of available objects to search can be found in the Help Center (may vary for each installation). You can find the entire metadata of each object there as well. - -Log in to your NetSuite account > Suite Cloud (Customization, Scripting, and Web Services) > SuiteCloud Platform Introduction > SuiteCloud Records Reference Tools > The SuiteScript Records Browser > Click 'Go to the SuiteScript Records Browser.' -![SuiteScript Records Browser](https://user-images.githubusercontent.com/8449044/61944948-8490eb80-afa7-11e9-9272-60f63a387ebc.png) - -Then choose Schema Browser > 'common' from the dropdown list and open the `Search` tab at the left. -![Common](https://user-images.githubusercontent.com/8449044/61945260-34feef80-afa8-11e9-8026-8e995dcff3d1.png) - -What you should do next is to build a correct search request using object fields and operators. -##### Search operators -It is just the recommended list. You should always use an actual one based on the Help center of your account. - -**GetSelectValueFilterOperator**: -
Click to expand - -* contains -* is -* startsWith -
- -**SearchDateFieldOperator**: -
Click to expand - -* after -* before -* empty -* notAfter -* notBefore -* notEmpty -* notOn -* notOnOrAfter -* notOnOrBefore -* notWithin -* on -* onOrAfter -* onOrBefore -* within -
- -**SearchDoubleFieldOperator**: -
Click to expand - -* between -* empty -* equalTo -* greaterThan -* greaterThanOrEqualTo -* lessThan -* lessThanOrEqualTo -* notBetween -* notEmpty -* notEqualTo -* notGreaterThan -* notGreaterThanOrEqualTo -* notLessThan -* notLessThanOrEqualTo -
- -**SearchEnumMultiSelectFieldOperator**: -
Click to expand - -* anyOf -* noneOf -
- -**SearchLongFieldOperator**: -
Click to expand - -* between -* empty -* equalTo -* greaterThan -* greaterThanOrEqualTo -* lessThan -* lessThanOrEqualTo -* notBetween -* notEmpty -* notEqualTo -* notGreaterThan -* notGreaterThanOrEqualTo -* notLessThan -* notLessThanOrEqualTo -
-**SearchMultiSelectFieldOperator**: -
Click to expand +NetSuite component includes the following actions: -* anyOf -* noneOf -
+ 1. [Add Object](/components/netsuite/actions#add-object) + Add an object to NetSuite. -**SearchStringFieldOperator**: -
Click to expand + 2. [Delete Object By Id](/components/netsuite/actions#delete-object-by-id) + Deletes an object by the ID provided. -* contains -* doesNotContain -* doesNotStartWith -* empty -* hasKeywords -* is -* isNot -* notEmpty -* startsWith -
+ 3. [Get Item Availability](/components/netsuite/actions#get-item-availability) + Allows to get an item availability based on its type and internal ID provided. -**SearchTextNumberFieldOperator**: -
Click to expand + 4. [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) + Lookup an object by the ID provided. -* between -* empty -* equalTo -* greaterThan -* greaterThanOrEqualTo -* lessThan -* lessThanOrEqualTo -* notBetween -* notEmpty -* notEqualTo -* notGreaterThan -* notGreaterThanOrEqualTo -* notLessThan -* notLessThanOrEqualTo -
+ 5. [Lookup Objects](/components/netsuite/actions#lookup-objects) + Looks for objects available in NetSuite which meet given criteria. -##### Basic Search Samples -###### Search contacts by a provided email -Object Type: Contact + 6. [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) + Either update an object in NetSuite by an ID provided or inserts as a new object if it does not exist. -Search Type: ContactSearchBasic - -XML request: -
Click to expand - -```xml - - - - YOURAPPLICATIONID - - - YOUREMAIL - YOURPASSWORD - YOURACCOUNT - - - - - - - - tomsmith@tomsmith.com - - - - - - -``` -
- -The same request for the component (JSON): -```json -{ - "email": { - "searchValue": "tomsmith@tomsmith.com", - "operator": { - "value": "is" - } - } -} -``` - -Response: -
Click to see the response - -```json -{ - "results": [ - { - "internalId": "4248", - "lastModifiedDate": "2018-08-17T08:51:19.000+0000", - "dateCreated": "2018-08-17T08:16:53.000+0000", - "globalSubscriptionStatus": { - "value": "_softOptIn" - }, - "subsidiary": { - "internalId": "3", - "name": "Honeycomb Holdings Inc." - }, - "isInactive": false, - "isPrivate": false, - "email": "tomsmith@tomsmith.com", - "lastName": "Smith", - "firstName": "Tom", - "salutation": "Smith", - "entityId": "Tom Smith" - } - ] -} -``` -
- -#### Joined search -Execute a search on a record type based on search filter fields on an associated record type. -A joined search allows you search against a specific record type using the fields on an associated record as search filters. -In the NetSuite UI, you can identify which associated records provide joined filter criteria by first navigating to a record's search interface. - -Once again, you can find the list of available objects in the Help Center. The component will dynamically fetch all the list with an available metadata. But you should always look at the documentation to build a correct search request. - -##### Joined Search Samples -###### Search contacts associated with customers - -Object Type: Contact - -Search Type: Contact Search Join - -The following sample shows how to return an associated joined list of records. In this case, all contacts associated with customers of internalId 1, 2 and 3 are returned. - -XML request: -
Click to expand - -```xml - - - - YOURAPPLICATIONID - - - YOUREMAIL - YOURPASSWORD - YOURACCOUNT - - - - - - - - - - - - - - - - -``` -
- -The same request for the component (JSON): -```json -{ - "customerJoin": { - "internalId": { - "searchValue": [ - { - "internalId": "449", - "name": "customer" - }, - { - "internalId": "500", - "name": "customer" - }, - { - "name": "customer", - "internalId": "594" - } - ], - "operator": { - "value": "anyOf" - } - } - } -} -``` - -Response -
Click to see the response - -```json -{ - "results": [ - { - "externalId": "Karen Austin / John Spear", - "internalId": "912", - "lastModifiedDate": "2019-07-24T09:54:53.000+0000", - "dateCreated": "2015-06-07T20:47:55.000+0000", - "globalSubscriptionStatus": { - "value": "_softOptIn" - }, - "supervisor": { - "internalId": "27", - "name": "Brad M Sparling" - }, - "mobilePhone": "(123) 545-6666", - "homePhone": "(222) 123-4321", - "officePhone": "(123) 456-7890", - "subsidiary": { - "internalId": "1", - "name": "Honeycomb Mfg." - }, - "isInactive": false, - "isPrivate": false, - "defaultAddress": "Brandy Dough
7829 N. Commerce Avenue
San Francisco CA
United States", - "email": "bdickens@ramsey.com", - "phone": "(123) 456-7890", - "title": "Purchasing", - "lastName": "Dickens", - "firstName": "Brandy", - "entityId": "Brandy Dickens" - }, - { - "internalId": "1545", - "lastModifiedDate": "2019-07-24T09:56:22.000+0000", - "dateCreated": "2015-03-18T14:35:42.000+0000", - "globalSubscriptionStatus": { - "value": "_softOptIn" - }, - "supervisor": { - "internalId": "1516", - "name": "Brenda Jones" - }, - "homePhone": "(713) 456-7878", - "subsidiary": { - "internalId": "1", - "name": "Honeycomb Mfg." - }, - "isInactive": false, - "isPrivate": false, - "defaultAddress": "123
Ave B
Houston TX 78665
United States", - "email": "adminaccess2@ramsey.com", - "phone": "(713) 456-7878", - "lastName": "Samms", - "firstName": "Brandy", - "entityId": "Brandy Samms" - } - ] -} -``` -
- -###### Search items with a price equal to 10 - -Object Type: Item - -Search Type: Item Search Join - -The following sample shows how to search for all items that have a price level of 10.00. - -XML request: -
Click to expand - -```xml - - - - YOURAPPLICATIONID - - - YOUREMAIL - YOURPASSWORD - YOURACCOUNT - - - - - - - - _inventoryItem - - - - - 10 - - - - - - -``` -
- -The same request for the component (JSON): -```json -{ - "pricingJoin": { - "rate": { - "operator": { - "value": "equalTo" - }, - "searchValue": 10 - } - }, - "basic": { - "type": { - "operator": { - "value": "anyOf" - }, - "searchValue": [ - "_inventoryItem" - ] - } - } -} -``` - -Response -
Click to see the response - -```json -{ - "results": [ - { - "externalId": "ITEM163", - "internalId": "163", - "customFieldList": { - "customField": [ - { - "value": false, - "scriptId": "custitem16", - "internalId": "194" - } - ] - }, - "supplyReplenishmentMethod": { - "internalId": "REORDER_POINT", - "name": "Reorder Point" - }, - "currency": "USA", - "availableToPartners": false, - "isInactive": true, - "offerSupport": false, - "isOnline": true, - "displayName": "Reserve Pinot Noir 2000", - "itemId": "Reserve Pinot Noir 2000", - "outOfStockBehavior": { - "value": "_default" - }, - "onSpecial": false, - "dontShowPrice": false, - "showDefaultDonationAmount": false, - "isDonationItem": false, - "sitemapPriority": { - "value": "_auto" - }, - "excludeFromSitemap": false, - "autoReorderPoint": true, - "seasonalDemand": false, - "autoPreferredStockLevel": true, - "autoLeadTime": true, - "leadTime": 0, - "useBins": false, - "cost": 6, - "overallQuantityPricingType": { - "value": "_byLineQuantity" - }, - "costEstimateType": { - "value": "_averageCost" - }, - "useMarginalRates": false, - "costCategory": { - "internalId": "3", - "name": "Default" - }, - "shipIndividually": false, - "enforceMinQtyInternally": true, - "roundUpAsComponent": false, - "isSpecialOrderItem": false, - "isDropShipItem": false, - "trackLandedCost": false, - "costingMethodDisplay": "Average", - "weightUnit": { - "value": "_lb" - }, - "weight": 5, - "billExchRateVarianceAcct": { - "internalId": "152", - "name": "5097 Bill Exchange Rate Variance" - }, - "billPriceVarianceAcct": { - "internalId": "151", - "name": "5096 Bill Price Variance" - }, - "billQtyVarianceAcct": { - "internalId": "150", - "name": "5095 Bill Quantity Variance" - }, - "matchBillToReceipt": false, - "assetAccount": { - "internalId": "120", - "name": "Inventory Asset" - }, - "taxSchedule": { - "internalId": "1", - "name": "S1" - }, - "incomeAccount": { - "internalId": "56", - "name": "4002 Sales : Sales - Merchandise" - }, - "includeChildren": true, - "salesDescription": "Reserve Pinot Noir 2000", - "cogsAccount": { - "internalId": "121", - "name": "Cost of Goods Sold" - }, - "copyDescription": false, - "purchaseDescription": "Reserve Pinot Noir 2000", - "lastModifiedDate": "2016-01-18T08:05:19.000+0000", - "createdDate": "2015-06-12T21:29:35.000+0000" - }, - { - "externalId": "ITEM164", - "internalId": "164", - "customFieldList": { - "customField": [ - { - "value": false, - "scriptId": "custitem16", - "internalId": "194" - } - ] - }, - "supplyReplenishmentMethod": { - "internalId": "REORDER_POINT", - "name": "Reorder Point" - }, - "currency": "USA", - "availableToPartners": false, - "isInactive": true, - "offerSupport": false, - "isOnline": true, - "displayName": "Crystallus 2002", - "itemId": "Crystallus 2002", - "outOfStockBehavior": { - "value": "_default" - }, - "onSpecial": false, - "dontShowPrice": false, - "showDefaultDonationAmount": false, - "isDonationItem": false, - "sitemapPriority": { - "value": "_auto" - }, - "excludeFromSitemap": false, - "autoReorderPoint": true, - "seasonalDemand": false, - "autoPreferredStockLevel": true, - "autoLeadTime": true, - "leadTime": 0, - "useBins": false, - "cost": 5, - "overallQuantityPricingType": { - "value": "_byLineQuantity" - }, - "costEstimateType": { - "value": "_averageCost" - }, - "useMarginalRates": false, - "costCategory": { - "internalId": "3", - "name": "Default" - }, - "shipIndividually": false, - "enforceMinQtyInternally": true, - "roundUpAsComponent": false, - "isSpecialOrderItem": false, - "isDropShipItem": false, - "trackLandedCost": false, - "costingMethodDisplay": "Average", - "weightUnit": { - "value": "_lb" - }, - "weight": 5, - "billExchRateVarianceAcct": { - "internalId": "152", - "name": "5097 Bill Exchange Rate Variance" - }, - "billPriceVarianceAcct": { - "internalId": "151", - "name": "5096 Bill Price Variance" - }, - "billQtyVarianceAcct": { - "internalId": "150", - "name": "5095 Bill Quantity Variance" - }, - "matchBillToReceipt": false, - "assetAccount": { - "internalId": "120", - "name": "Inventory Asset" - }, - "taxSchedule": { - "internalId": "1", - "name": "S1" - }, - "incomeAccount": { - "internalId": "56", - "name": "4002 Sales : Sales - Merchandise" - }, - "includeChildren": true, - "salesDescription": "Crystallus 2002", - "cogsAccount": { - "internalId": "121", - "name": "Cost of Goods Sold" - }, - "copyDescription": false, - "purchaseDescription": "Crystallus 2002", - "lastModifiedDate": "2016-01-18T08:05:19.000+0000", - "createdDate": "2015-06-12T21:29:35.000+0000" - } - ] -} -``` -
+ 7. [Lookup Objects By Custom Field](/components/netsuite/actions#lookup-objects-by-custom-field) + Looks for objects available in NetSuite which meet given custom string field criteria. -#### Advanced search -Execute a search on a record type in which you specify search filter fields and/or search return columns or joined search columns. -Using advanced search, you can also return an existing saved search. + 8. [Update Object](/components/netsuite/actions#update-object) + Update an object in NetSuite. -Advanced searching provides users with the ability to: -* Perform a search that references an existing saved search -* Perform a search that references an existing saved search, and then overrides existing search return columns with new search return columns -* Perform a search that references an existing saved search, and then provides additional search filter criteria (on top of the criteria already specified in the saved search) -* Perform a search that specifies search criteria and search result columns +The following NetSuite actions are deprecated: -The SOAP web services API includes advanced search objects for all records that have an existing search interface. + 1. [Lookup Customer(deprecated)](/components/netsuite/deprecated-functions#lookup-customerdeprecated) + Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead. This action enables to find the customer by provided ID. -Please check your 'Advanced Search' Help center section in order to build a correct request. You can find it in the following way: + 2. [Lookup Invoice(deprecated)](/components/netsuite/deprecated-functions#lookup-invoicedeprecated) + Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead. This action can be used to find invoices by provided ID. -Log in to your NetSuite account > Suite Cloud (Customization, Scripting, and Web Services) > SuiteTalk Web Services > SuiteTalk SOAP Web Services Platform Guide > SOAP Web Services operations > search > Advanced Searches in SOAP Web Services. + 3. [Upsert Customer(deprecated)](/components/netsuite/deprecated-functions#upsert-customerdeprecated) + Deprecated. Use [Lookup Object By Id](/components/netsuite/actions#lookup-object-by-id) action instead. Create new or update existing customer by provided external ID. -The component will always fetch all the existing metadata for the advanced search for you. All you should do is to delete what you don't need and to build a correct request based on the documentation. + 4. [Upsert Contact(deprecated)](/components/netsuite/deprecated-functions#upsert-contactdeprecated) + Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. Create new or update existing contact by provided external ID. -##### Known Limitations - - Enum values for condition operators accessible only in the `Basic search` type. - - Input metadata for property columns absent for object type: `Transaction` and `Advance Search` search type. - - The following transaction searches are not supported: -
Click to expand + 5. [Upsert Invoice(deprecated)](/components/netsuite/deprecated-functions#upsert-invoicedeprecated) + Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. Create new or update existing invoice by provided external ID. - - Blanket Purchase Order - - CCard Refund - - Commission - - Credit Card - - Currency Revaluation - - Customer Payment Authorization - - Deprecated Custom Transaction - - Finance Charge - - Fulfillment Request - - GL Impact Adjustment - - Inventory Count - - Inventory Distribution - - Inventory Status Change - - Inventory Worksheet - - Liability Adjustment - - Ownership Transfer - - Payroll Adjustment - - Payroll Liability Check - - Period End Journal - - Purchase Contract - - Request For Quote - - Revenue Arrangement - - Revenue Commitment - - Revenue Commitment Reversal - - Revenue Contract - - Sales Tax Payment - - Statement Charge - - Store Pickup Fulfillment - - System Journal - - Tax Liability Cheque - - Tegata Payable - - Tegata Receivable - - Transfer - - Vendor Request For Quote -
+ 6. [Upsert Sales Order(deprecated)](/components/netsuite/deprecated-functions#upsert-sales-orderdeprecated) + Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. Create new or update existing sales order by provided external ID. -##### Advanced Search Samples -###### Execute saved search + 7. [Upsert Vendor(deprecated)](/components/netsuite/deprecated-functions#upsert-vendordeprecated) + Deprecated. Use [Upsert Object By Id](/components/netsuite/actions#upsert-object-by-id) action instead. Create new or update existing vendor by provided external ID. -Object Type: Customer +## Upsert custom fields -Search Type: Customer Search Advanced - -The following sample shows how to find customers, using saved search (by a keyword in an email). - -XML request: -
Click to expand - -```xml - - - - YOURAPPLICATIONID - - - YOUREMAIL - YOURPASSWORD - YOURACCOUNT - - - - - - - - -``` -
- -The same request for the component (JSON): -```json -{ - "savedSearchId": "740" -} -``` - -Response -
Click to see the response - -```json -{ - "results": [ - { - "basic": { - "salesRep": [ - { - "searchValue": { - "internalId": "1008" - } - } - ], - "phone": [ - { - "searchValue": "937-287-2222" - } - ], - "internalId": [ - { - "searchValue": { - "internalId": "980" - } - } - ], - "entityId": [ - { - "searchValue": "D&H Manufacturing" - } - ], - "billState": [ - { - "searchValue": "OH" - } - ], - "billCity": [ - { - "searchValue": "Dayton" - } - ], - "billAddress1": [ - { - "searchValue": "410 E. Fifth St." - } - ] - } - } - ] -} -``` -
- -### Lookup Objects By Custom Field -Looks for objects available in NetSuite which meet given custom string field criteria. - -#### Lookup Objects By Custom Field. Config fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer, Invoice, Cash Sale etc.). Fetches dynamically. - -Input metadata objects: -* Custom field name - name of the custom field. E.g. `custbody_tran_number` -* Custom field value - value of the custom field. E.g. `ABC-123` - -```json -{ - "customFieldName": "custbody_tran_number", - "customFieldValue": "ABC-123" -} -``` - -### Update Object -Update an object in NetSuite. - -### Update Object. Config Fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. - -#### Update Object. Input Metadata -Is being fetched dynamically. Sample: - -
Input metadata for Invoice object: - -```json -{ - "internalId": "13817", - "entity": { - "internalId": "5" - }, - "currency": { - "internalId": "1" - }, - "tranDate": "2023-05-23", - "itemList": { - "item": [ - { - "description": "General Donation", - "amount": 1000, - "item": { - "internalId": "12" - }, - "quantity": 1, - "rate": "100", - "taxCode": { - "internalId": "5" - }, - "customFieldList": { - "customField": [ - { - "type": "SelectCustomFieldRef", - "scriptId": "asd_d3", - "value": { - "name": "Charity type", - "internalId": "2" - } - } - ] - } - } - ] - }, - "customFieldList": { - "customField": [ - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-one", - "value": "Bank Transfer" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-two", - "value": "Individual One-Off" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-three", - "value": "John Doe" - }, - { - "type": "StringCustomFieldRef", - "scriptId": "custbody_sf_field-four", - "value": "ABC-987" - } - ] - } -} -``` -
- -### Upsert Object By ID -Either update an object in NetSuite by an ID provided or inserts as a new object if it does not exist. - -### Upsert Object By ID. Config Fields -* **Object Category** - a category of an object in NetSuite - * Standard - * Custom -* **Object Type** - an object in NetSuite (Contact, Customer etc.). Fetches dynamically. - -### Lookup Customer (deprecated) -Deprecated. Use `Lookup Object By Id` action instead. -Find customer by provided ID. - -#### How to use Lookup Customer Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/13310949/44708435-dab39100-aaaf-11e8-837d-7be16b43ff07.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/13310949/44708436-db4c2780-aaaf-11e8-93f7-e98efe01a357.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/13310949/44708438-db4c2780-aaaf-11e8-99f0-fe9f3b076f28.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/13310949/44708439-db4c2780-aaaf-11e8-9d50-aeb5a3a08a5e.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44708442-dbe4be00-aaaf-11e8-889a-8fa735fe7716.png) - -You can provide **internal**, **external** id or **all** of them in input message. -If entity doesn't have **externalId** You must specify only **internalId** in input message. - -If you specify incorrect internal or external id, You will get error "**That record does not exist.**" - -For example: - - - externalId exists -```json -{ - "internalId":"1234", - "externalId":"4567" -} -``` - - externalId does not exist - -```json -{ - "internalId":"1234" -} -``` - -#### Lookup Customer. Input metadata -`./schemas/json/LookupCustomerById.in.json` - -### Lookup Invoice (deprecated) -Deprecated. Use `Lookup Object By Id` action instead. - -Finds invoice by provided ID. - -#### How to use Lookup Invoice Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/13310949/44712312-20c12280-aab9-11e8-9809-210c29c56b35.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/13310949/44712313-20c12280-aab9-11e8-8eed-c09f423f012a.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/13310949/44712315-2159b900-aab9-11e8-9a86-4133ded721f3.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/13310949/44712316-2159b900-aab9-11e8-999e-edfc86bd7f5d.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44712318-2159b900-aab9-11e8-9c51-b5f62b1bfb29.png) - -You can provide **internal**, **external** id or **all** of them in input message. -If entity doesn't have **externalId** You must specify only **internalId** in input message. - -If You specify incorrect internal or external id, You will get error "**That record does not exist.**" - -For example: - - - externalId exists -```json -{ - "internalId":"1234", - "externalId":"4567" -} -``` - - externalId does not exist - -```json -{ - "internalId":"1234" -} -``` - -#### Lookup Invoice. Input metadata -`./schemas/json/GetInvoiceById.json` - -### Upsert Contact (deprecated) -Deprecated. Use `Upsert Object By Id` action instead. - -Create new or update existing contact by provided external ID. - -#### How to use Upsert Contact Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/16806832/44841590-63ffca80-ac4c-11e8-8757-56f643755186.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/16806832/44841748-c2c54400-ac4c-11e8-8f34-8b6604ffd5f8.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/16806832/44841820-edaf9800-ac4c-11e8-80ae-b83eaae3685f.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/16806832/44842428-77139a00-ac4e-11e8-964d-95a429791b69.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44706289-c1a7e180-aaa9-11e8-8b06-ac04d2876570.png) - -#### Upsert Contact. Input metadata -`./schemas/json/Contact.json` - -Request sample: -```json -{ - "externalId": "entity164", - "customForm": { - "internalId": "-40", - "name": "Standard Contact Form" - }, - "entityId": "Olha Grogan", - "salutation": "Mrs.", - "firstName": "Olha", - "lastName": "Grogan", - "subsidiary": { - "internalId": "1", - "name": "Honeycomb Mfg." - } -} -``` - -### Upsert Customer (deprecated) -Deprecated. Use `Upsert Object By Id` action instead. - -Creates new or updates an existing customer by provided external ID. - -#### How to use Upsert Customer Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/13310949/44706283-c10f4b00-aaa9-11e8-9c60-057553824b45.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/13310949/44706284-c10f4b00-aaa9-11e8-8622-6e33b5bbb480.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/13310949/44706286-c10f4b00-aaa9-11e8-8f63-f24a7f5801bf.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/13310949/44706287-c10f4b00-aaa9-11e8-8d3c-70bd2e4ec32b.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44706289-c1a7e180-aaa9-11e8-8b06-ac04d2876570.png) - -#### Upsert Customer. Input metadata -`./schemas/json/Customer.json` - -Request sample: -```json -{ - "externalId": "external order ID", - "customerId": "internal customer ID", - "currency": "USA", - "exchangeRate": 1.0, - "orderItems": [ - { - "itemInternalId": "387", - "quantity": 10 - - } - ] -} - -``` - -### Upsert Invoice (deprecated) -Deprecated. Use `Upsert Object By Id` action instead. - -Creates new or update existing invoice by provided external ID. - -#### How to use Upsert Invoice Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/8449044/45221760-1d991400-b2bb-11e8-96fa-a07cbdff5a92.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/8449044/45221776-2984d600-b2bb-11e8-96bf-bf35e84b02c1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/8449044/45221590-9a77be00-b2ba-11e8-9e93-e2748dfce4dd.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/8449044/45221625-b24f4200-b2ba-11e8-86a0-9d478d0e55c6.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/8449044/45221640-c09d5e00-b2ba-11e8-9b1c-192e072055fa.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/8449044/45221667-d3179780-b2ba-11e8-8327-5f90e4728936.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/8449044/45221707-f0e4fc80-b2ba-11e8-897a-d784dcc2d35c.png) - -#### Upsert Invoice. Input metadata: -`./schemas/json/Invoice.json` - -
Click to see the response - -Request sample: -```json -{ - "externalId": "23213000001", - "customForm": { - "name": "HM Product Invoice", - "internalId": "102" - }, - "entity": { - "name": "Jennings Financial", - "internalId": "81" - }, - "terms": { - "name": "Net 30", - "internalId": "2" - }, - "subsidiary": { - "name": "Honeycomb Mfg.", - "internalId": "1" - }, - "currency": { - "name": "USA", - "internalId": "1" - }, - "location": { - "name": "02: Boston", - "internalId": "1" - }, - "isTaxable": true, - "taxItem": { - "name": "CA-SAN MATEO", - "internalId": "-112" - }, - "taxRate": 8.25, - "fax": "916-555-0806", - "message": "We appreciate your prompt payment", - "shipMethod": { - "name": "Truck", - "internalId": "3" - }, - "itemList": { - "item": [ - { - "job": null, - "item": { - "name": "CHA00002®", - "internalId": "707", - "externalId": null, - "type": null - }, - "line": 1, - "description": "Assembly Item - Historical", - "amount": 7020, - "isTaxable": null, - "quantity": 36, - "price": { - "name": "List Price", - "internalId": "1" - }, - "rate": "195.00", - "taxCode": { - "name": "-Not Taxable-", - "internalId": "-7" - } - } - ], - "replaceAll": false - }, - "shippingCost": 704.25, - "customFieldList": { - "customField": [ - { - "type": "BooleanCustomFieldRef", - "internalId": "167", - "scriptId": "custbody_fmt_senior_exec_declined", - "value": false - } - ] - } -} -``` -
- -### Upsert Sales Order (deprecated) -Deprecated. Use `Upsert Object By Id` action instead. - -Creates new or update existing sales order by provided external ID. - -#### How to use Upsert Sales Order Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action "Upsert Sales Order" from list -![Step 3](https://user-images.githubusercontent.com/16806832/45081682-68baf780-b100-11e8-935d-22ab98b74233.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/16806832/45082400-e9c6be80-b101-11e8-9006-eb0fb07d60bc.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/16806832/44841820-edaf9800-ac4c-11e8-80ae-b83eaae3685f.png) - -##### Retrieve sample result and click "Continue" -![Step 6](https://user-images.githubusercontent.com/16806832/45082510-27c3e280-b102-11e8-8a18-42cb5358efa5.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44706289-c1a7e180-aaa9-11e8-8b06-ac04d2876570.png) - -#### Upsert Sales Order. Input metadata -`./schemas/json/SalesOrder.json` - -Request sample: -```json -{ - "externalId": "80144000000B5wqAAC", - "orderStatus": "_pendingFulfillment", - "currency": { - "name": "USA", - "internalId": "1" - }, - "customForm": { - "internalId": "174", - "name": "Z - HM Sales Order Form" - }, - "entity": { - "internalId": "2053" - }, - "exchangeRate": "1.0", - "toBePrinted":"false" -} -``` - -### Upsert Vendor (deprecated) -Deprecated. Use `Upsert Object By Id` action instead. - -Creates new or update existing vendor by provided external ID. - -#### How to use Upsert Vendor Action -##### Find and select NetSuite component in the component repository -![Step 1](https://user-images.githubusercontent.com/13310949/44709539-8cec5800-aab2-11e8-88cd-b29508220dd3.png) - -##### Create new or select existing credentials -![Step 2](https://user-images.githubusercontent.com/16806832/44349488-cf57d880-a4a5-11e8-86d6-542e13536de1.png) - -##### Select action from list -![Step 3](https://user-images.githubusercontent.com/13310949/44707033-19474c80-aaac-11e8-909c-0496be43bea0.png) - -##### Set input message or bind data from previous step -![Step 4](https://user-images.githubusercontent.com/13310949/44707035-19474c80-aaac-11e8-8cfa-d71df74644b0.png) - -##### Retrieving sample -![Step 5](https://user-images.githubusercontent.com/13310949/44707037-19474c80-aaac-11e8-8e5e-075addf680f6.png) - -##### Retrieve sample result -![Step 6](https://user-images.githubusercontent.com/13310949/44707038-19dfe300-aaac-11e8-961d-286cdce3b06a.png) - -##### Finish component configuration -![Step 7](https://user-images.githubusercontent.com/13310949/44707040-19dfe300-aaac-11e8-83b2-b9f2c3527456.png) - -Request sample: - -```json -{ - "externalId": "9999", - "entityId": "Nick", - "isPerson": "false", - "companyName": "Nick2", - "phone": "937 99 92", - "fax": "937 99 92", - "email": "nick2@nickthebest.com", - "url": "http://www.nickthebest2.com", - "customFieldList": { - "customField": [ - { - "internalId": "3992", - "scriptId": "custentity_2663_payment_method", - "type": "BooleanCustomFieldRef", - "value": "false" - }, - { - "internalId": "3993", - "scriptId": "custentity_2663_payment_method", - "type": "BooleanCustomFieldRef", - "value": "false" - } - ] - } -} -``` - -#### Upsert Vendor. Input metadata -`./schemas/json/Vendor.json` - -### Upsert Custom Fields Currently, You can upsert custom fields only from developer mode. You should to use property **type**, which can accept next values: - - BooleanCustomFieldRef - - DateCustomFieldRef - - DoubleCustomFieldRef - - LongCustomFieldRef - - MultiSelectCustomFieldRef - - SelectCustomFieldRef - - StringCustomFieldRef + +- `BooleanCustomFieldRef` +- `DateCustomFieldRef` +- `DoubleCustomFieldRef` +- `LongCustomFieldRef` +- `MultiSelectCustomFieldRef` +- `SelectCustomFieldRef` +- `StringCustomFieldRef` You can find example of custom field structures bellow. - - **BooleanCustomFieldRef** -```json +- **`BooleanCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1804,8 +141,9 @@ You should to use property **type**, which can accept next values: } ``` - - **DateCustomFieldRef** -```json +- **`DateCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1814,8 +152,9 @@ You should to use property **type**, which can accept next values: } ``` - - **DoubleCustomFieldRef** -```json +- **`DoubleCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1824,8 +163,9 @@ You should to use property **type**, which can accept next values: } ``` - - **LongCustomFieldRef** -```json +- **`LongCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1834,8 +174,9 @@ You should to use property **type**, which can accept next values: } ``` - - **MultiSelectCustomFieldRef** -```json +- **`MultiSelectCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1857,8 +198,9 @@ You should to use property **type**, which can accept next values: } ``` -- **SelectCustomFieldRef** -```json +- **`SelectCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1872,8 +214,9 @@ You should to use property **type**, which can accept next values: } ``` - - **StringCustomFieldRef** -```json +- **`StringCustomFieldRef`** + +```javascript { "internalId": "1", "scriptId": "script1", @@ -1882,11 +225,6 @@ You should to use property **type**, which can accept next values: } ``` -## Known limitations - - Currently 'Vendor payments' and 'Customer payments' types are supported for the `Search Entity` trigger. - - Calling [Get New and Updated Objects Polling](#Get New and Updated Objects Polling) with Size of Polling Page less then 5 returns Error while NetSuite API call \[Invalid search page size.\] - ## Links -[API docs](http://www.netsuite.com/portal/developers/resources/suitetalk-documentation.shtml) -[Open Integration Hub Standards](https://github.com/openintegrationhub/Connectors/blob/master/Adapters/AdapterBehaviorStandardization/StandardizedActionsAndTriggers.md#lookup-objects-plural) +[NetSuite API docs](http://www.netsuite.com/portal/developers/resources/suitetalk-documentation.shtml). diff --git a/content/_components/netsuite/triggers.md b/content/_components/netsuite/triggers.md new file mode 100644 index 00000000..1d23239c --- /dev/null +++ b/content/_components/netsuite/triggers.md @@ -0,0 +1,75 @@ +--- +title: NetSuite triggers +layout: component +description: NetSuite component triggers. +icon: netsuite.png +icontext: NetSuite component +category: netsuite +updatedDate: 2023-05-26 +ComponentVersion: 3.1.0 +--- + +## Get New and Updated Objects Polling + +Generic trigger that polls NetSuite instance for new and/or updated objects (of any type available in the NetSuite). + +![Get New and Updated Objects Polling](img/get-new-update-objects-polling.png) + +### Config fields + +* Object Type (dropdown) + +* Start Time (string, optional): Indicates the beginning time to start polling from (defaults to the beginning of time) + +* End Time (string, optional): If provided, don’t fetch records modified after this time (defaults to never) + +* Size of Polling Page (optional; string). Indicates the size of pages to be fetched. Defaults to 1000. CAN NOT be less then 5. + +* Single Page per Interval (dropdown/checkbox: yes/no; default yes). Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page immediately, wait until the next flow start to fetch the next page. + +First, the system reads all the objects of the chosen type and processes it further along with your designed integration flow. +It will also create an initial state of fetched objects, we call it a *snapshot*, in order to have something to compare with after your data is updated. + +After the initial read, any further requests for an update or create new object in NetSuite will be compared to this snapshot and in case any changes are detected they will be passed along with the integration flow as well. + + +## Polling objects +Find an object or a set of objects was updated since last polling of time. + +### Input fields +**Object Type** - Object type to poll (only for objects which support `lastModifiedDate` filtering). + +**Start Time** - Indicates the beginning time to start polling from (defaults to the beginning of time, in next format `yyyy-MM-ddTHH:mm:ss.SSS XXX`). + +**End Time** - If provided, don’t fetch records modified after this time (defaults to never, in next format `yyyy-MM-ddTHH:mm:ss.SSS XXX`). + +**Size of Polling Page** - Indicates the size of pages to be fetched. Defaults to 1000. + +**Single Page per Interval** - Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page immediately, wait until the next flow start to fetch the next page. + +## Known Limitations +At the moment trigger supports polling of next object types: + +* `Calendar Event`, +* `Campaign` +* `Contact` +* `Customer` +* `Employee` +* `Entity` +* `Entity Group` +* `Folder` +* `Issue` +* `Item` +* `Item Demand Plan` +* `Item Supply Plan` +* `Job` +* `Opportunity` +* `Originating Lead` +* `Partner` +* `Phone Call` +* `Project Task` +* `Solution` +* `Support Case` +* `Task` +* `Transaction` +* `Vendor` diff --git a/content/_components/sftp/actions.md b/content/_components/sftp/actions.md new file mode 100644 index 00000000..c06c5fc4 --- /dev/null +++ b/content/_components/sftp/actions.md @@ -0,0 +1,213 @@ +--- +title: SFTP actions +layout: component +description: SFTP component actions. +icon: sftp.png +icontext: SFTP component +category: sftp +updatedDate: 2024-03-01 +ComponentVersion: 1.7.0 +--- + +## Delete File + +Action to delete file by provided full file path. If the file does not exist, the empty message (`{}`) is returned. + +> **Plesae Note:** To gain a better understanding of the functionality provided by Delete File action, we recommend checking out our [example article](/components/sftp/usage-example#delete-file). It provides a detailed walkthrough of how to use Delete File action effectively, which will assist you in working with it. + +{% include img.html max-width="100%" url="img/delete.png" title="Delete File" %} + +### Configuration Fields + +There is no Configuration Fields. + +### Input Metadata + +- **Full Path** - (string, required): Full filename and path to the file. + +### Output Metadata + +- **id** - (string, required): Full filename and path to the file. + +## Download File by name + +Finds a file by name in the provided directory and either uploads (streams) its content to the attachment storage or emits its in Base64 representation as a message. + +{% include img.html max-width="100%" url="img/download-by-name.png" title="Download File by name" %} + +> **Plesae Note:** To gain a better understanding of the functionality provided by Download File by name action, we recommend checking out our [example article](/components/sftp/usage-example#download-file-by-name). It provides a detailed walkthrough of how to use Download File by name action effectively, which will assist you in working with it. + +### Configuration Fields + +* **Allow Empty Result** - (dropdown, optional, defaults to `No`): Do not throw an error when no objects were found. +* **Allow ID to be Omitted** - (dropdown, optional, defaults to `No`): Do not throw an error when object id is missing. +* **Emit file content (Base64)** - (checkbox, optional, defaults to `No`): When checked, a file will not be put into the internal storage. The file content in Base64 representation will be emitted as a part of the message. + + **Be careful:** Maximum message size supported on the platform is 10MB. This is why files bigger than 10MB will not be processed. + +### Input Metadata + +- **Path and File Name** - (string, required if `Allow ID to be Omitted` set to `No`): Full filename and path to the file. + +### Output Metadata + +* **type** - (string, required): File type. +* **name** - (number, required): File name. +* **size** - (number, required): File size. +* **owner** - (number, required): User identifier. +* **group** - (number, required): Group identifier. +* **accessTime** - (string, required): Last Access Time. +* **modifyTime** - (string, required): Last Modify Time. +* **rights** - (object, required): Rights to file on SFTP server. +* **directory** - (string, required): Directory. +* **path** - (string, required): Full Path. +* **attachment_url** - (string, required): Url to file in storage. This field will always be empty if the checkbox `Emit file content (Base64)` is checked. +* **base64Content** - (string, optional): Base64 file content. + +## Download Files + +Finds files by criteria in the provided directory and either uploads (streams) their content to the attachment storage or emits it in Base64 representation as a message. + +> **Plesae Note:** To gain a better understanding of the functionality provided by Download Files action, we recommend checking out our [example article](/components/sftp/usage-example#download-files). It provides a detailed walkthrough of how to use Download Files action effectively, which will assist you in working with it. + +{% include img.html max-width="100%" url="img/download-files.png" title="Download Files" %} + +### Configuration Fields + +* **Behavior** - (dropdown, required): Defines the way result objects will be emitted. + * **Fetch All** - All objects will be emitted as array in one object with key `results`. + * **Emit Individually** - Each object will be emitted separately filling the entire message. +* **Number of search terms** - (number, optional, between 0 and 99): Defines the number of search terms that the entity must match. +* **Upload files to attachment** - (dropdown, optional): If set to `Yes` files will be uploaded to platform storage. +* **File Upload Retry** - (number, optional, default 5): How many times to retry file upload as attachment to platform storage. +* **Retry Timeout** - (number, optional, default 10000): How long to wait between retry attempts in milliseconds. +* **File Upload Timeout** - (number, optional, default 10000): If a file upload process is longer than the specified number of milliseconds and is not processing any data (receiving or uploading), the timeout will be thrown (the process will be retried if \"File Upload Retry\" set). +* **Emit File Content (Base64)** - (checkbox, optional, defaults to `No`): When checked, the file will not be stored internally. Instead, its content will be emitted as part of the message, encoded in Base64. + * **Note**: The maximum supported message size on the platform is 10MB. Files larger than 10MB will not be processed. + * **Important**: This checkbox functions differently from the `Download File by Name` action. In the latter, file content is either attached to the message or emitted within the message body. However, in this action, the output depends on both this checkbox and the `Upload Files to Attachment` dropdown. The combination of these two fields can result in one of four outcomes: + * Upload file to attachment. Emit file content as a message. + * Upload file to attachment. Do not emit file content as a message. + * Do not upload file to attachment. Emit file content as a message. + * Do not upload file to attachment. Do not emit file content as a message. + +### Input Metadata + +* **Directory Path** - (string, required): The directory of the files to read from. +* **Max Size** - (number, optional, defaults to 250): Maximum number of objects to fetch. +* **Search term** - (object, required and appears if `Number of search terms` > 0): Criteria of the file to search: + * **Field Name** - (string, required): options are: + * **name** - File name. + * **modifyTime** - Last Modify Time. + * **accessTime** - Last Access Time. + * **size** - File size. + * **Condition** - (string, required): options are: + * **like** - like. + * **eq** - equal. + * **ne** - not equal. + * **gt** - greater than. + * **gte** - greater than or equal. + * **lt** - less than. + * **lte** - less than or equal. + * **Field Value** - (string, required): Value for selected term. +* **Criteria Link** - (string, required and appears if `Number of search terms` > 1): Determinate how to combine `Search terms`: + * **and** - All search term match. + * **or** - One or more search terms match. + +### Output Metadata + +* **type** - (string, required): File type. +* **name** - (number, required): File name. +* **size** - (number, required): File size. +* **owner** - (number, required): User identifier. +* **group** - (number, required): Group identifier. +* **accessTime** - (string, required): Last Access Time. +* **modifyTime** - (string, required): Last Modify Time. +* **rights** - (object, required): Rights to file on SFTP server. +* **directory** - (string, required): Directory. +* **path** - (string, required): Full Path. +* **attachment_url** - (string, optional): Url to file in storage. This field exists if the `Upload files to attachment` configuration set to true +* **base64Content** - (string, optional): Base64 file content + +## Move File + +Action to move file on SFTP already exists in one location on an sftp server to be moved to another location on the same SFTP server. +Target location MUST exist. If the target filename already exists it will be overwritten. This action uses the openssh POSIX rename extension introduced in OpenSSH 4.8 if it is available. The advantage of this version of rename over standard SFTP rename is that it is an atomic operation and will allow renaming a resource where the destination name exists. If the openssh POSIX rename mechanism is not available, then a delete operation and then rename operation will be completed. + +> **Plesae Note:** To gain a better understanding of the functionality provided by Move File action, we recommend checking out our [example article](/components/sftp/usage-example#move-file). It provides a detailed walkthrough of how to use Move File action effectively, which will assist you in working with it. + +{% include img.html max-width="100%" url="img/move-file.png" title="Move File" %} + +### Configuration Fields + +There is no Configuration Fields. + +### Input Metadata + +- **Current file Name and Path** - (string, required): Full filename and path to the file. +- **New file Name and Path** - (string, required): Full filename and path to the file to move. + +### Output Metadata + +- **filename** - (string, required): Full filename and path to the file where it was. +- **newFilename** - (string, required): Full filename and path to the file where is moved. + +## Upload File From URL + +> **Plesae Note:** To gain a better understanding of the functionality provided by Upload File From URL action, we recommend checking out our [example article](/components/sftp/usage-example#upload-file-from-url). It provides a detailed walkthrough of how to use Upload File From URL action effectively, which will assist you in working with it. + +Given a filename and a URL to an attachment, transfers the contents of the attachment to the SFTP server. + +{% include img.html max-width="100%" url="img/upload-file.png" title="Upload File From URL" %} + +### Configuration Fields + +* **Behavior When File Already Exists** - (dropdown, required): The expected behavior of the component when trying to write to a file that already exists: + * **Throw an Error**: Does not write data to the file and the component produces an error. + * **Overwrite the File**: Replace the existing file contents with the contents of the attachment stored in the platform. + * **Append the File Contents**: Adds the contents of the attachment stored in the platform to the end of the file. No intermediate characters (e.g. newlines or spaces) will be added. + +>**Please Note:** If the filename provided contains directories that do not exist, those directories will be created. + +### Input Metadata + +- **File Name and Path** - (string, required): Full filename and path to the file to write. Both absolute (e.g. `/home/myuser/somefolder/some.file`) and relative (e.g. `./somefolder/some.file`) paths are supported. Tilde (`~`) expansion is not supported. +- **Attachment URL** - (string, required): URL of the stored attachment to store in the file. +- **Encoding** - (string, optional): The encoding (if any) that should be applied to the written file. +- **File Mode** - (string/number, optional): The read/write/execute permissions for the file, defaults to 00666 (rwx). + +### Output Metadata + +* **mode** - (number, required): permissions for the file. +* **size** - (number, required): File Size. +* **uid** - (number, required): User identifier. +* **gid** - (number, required): Group identifier. +* **accessTime** - (string, required): Last Access Time. +* **modifyTime** - (string, required): Last Modify Time. +* **isDirectory** - (boolean, required): Is it directory. +* **isFile** - (string, required): Is it file. + + +## Upload Files From Attachments Header + +> **Plesae Note:** To gain a better understanding of the functionality provided by Upload Files From Attachments Header action, we recommend checking out our [example article](/components/sftp/usage-example#upload-files-from-attachments-header). It provides a detailed walkthrough of how to use Move Upload Files From Attachments Header action effectively, which will assist you in working with it. + +{% include img.html max-width="100%" url="img/upload-files-from-attachments-header.png" title="Upload Files From Attachments Header" %} + +### Configuration Fields + +- **Directory** - (string, required): The directory where the file will be uploaded to, if the directory does not exist, it will create it at the risk of possibly overwriting any files that may have the same name. + +### Input Metadata + +* **Filename** - (string, optional): Custom name for uploaded file. + * **Note 1** Uploaded file name will get filename of income file if new `Filename` doesn't provided. + * **Note 2** `Filename` will be added at the beggining of attachment name if income message contains multiple attachments: `[SpecifiedFilename]_[NameOfExistedFile]`. + * **Note 3** File will be overwritten in case when file with specified name already exists in directory. + +### Output Metadata + +An object, with key `results` that has an array as its value. + +* **attachment** - (string, required): File Name. +* **uploadedOn** - (string, required): Upload datetime. +* **path** - (string, required): Full Path to file. diff --git a/content/_components/sftp/index.md b/content/_components/sftp/index.md index ef0c2b9b..079f053c 100644 --- a/content/_components/sftp/index.md +++ b/content/_components/sftp/index.md @@ -10,265 +10,58 @@ updatedDate: 2024-09-05 ComponentVersion: 1.7.3 --- -## Table of Contents +## General Information -* [Description](#description) -* [Environment variables](#environment-variables) -* [Credentials](#credentials) -* [Triggers](#triggers) - * [Poll Files](#poll-files) - * [Deprecated triggers](#deprecated-triggers) -* [Actions](#actions) - * [Delete File](#delete-file) - * [Download File by name](#download-file-by-name) - * [Download Files](#download-files) - * [Move File](#move-file) - * [Upload File From URL](#upload-file-from-url) - * [Upload Files From Attachments Header](#upload-files-from-attachments-header) +This component creates a connection to an external SFTP server so you can work with the files. You can use this component to read, write, move or delete the files on your SFTP server. The component has trigger and action functions covering each use case. + +If you are interested in the past changes that the component has undergone check the [changelog](technical-notes#changelog). -## Description -This component creates a connection to an SFTP server to read and upload files. ## Environment variables -Name|Mandatory|Description|Values| +The SFTP component works with different files sizes and different SFTP servers. To have more control over the process you can apply environment variables to further suit your scenarios. + +|Name|Mandatory|Description|Values| |----|---------|-----------|------| -|`MAX_FILE_SIZE`| false | Maximum file size that can be uploaded in **megabytes (mb)** (100MB by default) | any `integer` above 0| +|`MAX_FILE_SIZE`| `False` | Maximum file size that can be uploaded in **megabytes (mb)** (100MB by default) | any `integer` above 0| ## Credentials -* **Host** - (string, required): Host name of SFTP server -* **Port** - (number, optional, defaults to 22): Port of SFTP server -* **User Name** - (string, required): Username for SFTP server -* **Password** - (string, optional): Password for SFTP server. Must stay empty in case you fill a private key field -* **Private Key** - (string, optional): To access a secure SFTP servers that is configured with a key-based authentication you must at first upload your `Public key` to the SFTP server (please contact your server administrator to do this) and fill in this field with your `Private key`. - Must stay empty in case you fill a password key field. - The component has been tested with the following keys: - * rsa (Minimum allowed key length - 2048 bits, minimum recommended - 3072 bits) - * rsa-sha2-256 - * rsa-sha2-512 - * ed25519 - * ecdsa - -* **Passphrase** - (string, optional): If Private Key was created using passphrase, put it here - -## Triggers - -### Poll Files -Triggers to get all new and updated files since last polling. - -#### Configuration Fields -* **Directory** - (string, required): The directory of the files to read from -* **Emit Behaviour** - (dropdown, optional): Defines the way result objects will be emitted, defaults to `Emit individually` - * **Fetch All** - All objects will be emitted as array in one object with key `results` - * **Emit Individually** - Each object will be emitted separately filling the entire message -* **Start Time** - (string, optional): Start datetime of polling, defaults to`-271821-04-20T00:00:00.000Z` -* **End Time** - (string, optional): End datetime of polling, defaults to `+275760-09-13T00:00:00.000Z` -* **Pattern** - (string, optional): Regex pattern for file names. If no pattern is given, no matching is done - - -#### Output Metadata -* **filename** - (string, required): File Name -* **size** - (number, required): File Size -* **type** - (string, required): File Type -* **modifyTime** - (string, required): Last Modification Time -* **accessTime** - (string, required): Last Access Time -* **directory** - (string, required): Directory -* **path** - (string, required): Full Path - -#### Known limitations -* Trigger mechanism is based on SFTP file `modifyTime` metadata field. For correct processing the trigger requires correct time configuration on the SFTP server. - -### Deprecated Triggers - -#### Read Files +To authenticate with an external SFTP server you must fill-in the necessary values in the credentials section. -Will continuously poll remote SFTP location for files that match given pattern. Found files will be transferred as attachments to the next component +* **Host** - (string, required): Host name of SFTP server. +* **Port** - (number, optional, defaults to 22): Port of SFTP server. +* **User Name** - (string, required): Username for SFTP server. +* **Password** - (string, optional): Password for SFTP server. +>**Plese Note:** field `Password` should be empty in case you fill a `Private Key`. +* **Private Key** - (string, optional): To access a secure SFTP servers that is configured with a key-based. authentication you must at first upload your `Public key` to the SFTP server (please contact your server administrator to do this) and fill in this field with your `Private key`. +* **Passphrase** - (string, optional): If Private Key was created using passphrase, put it here. +>**Plese Note:** field `Private Key` should stay empty in case you fill a password. -After a file is found: - * It is moved to the (hidden) directory `.elasticio_processed` and to name of the file will be added timestamp, ex.: file `test.txt` will be renamed to `test.txt_1657621889133` - * It is pulled and uploaded (streamed) to the attachment storage -Note: you may need to consider cleaning up the `.elasticio_processed` directory manually - -##### Configuration Fields - -* **Directory** - (string, required): The directory of the files to read from -* **Pattern** - (string, optional): Regex pattern for file names. If no pattern is given, no matching is done. - -##### Input Metadata - -none +## Triggers -##### Output Metadata +SFTP component includes the following triggers: -* **filename** - (string, required): Name of the file -* **size** - (number, required): File size +1. [Poll files](triggers#poll-files) - Triggers to get all new and updated files since last polling. +2. [Read files(deprecated)](triggers#read-filesdeprecated) - Will continuously poll remote SFTP location for files that match given pattern. Found files will be transferred as attachments to the next component. ## Actions -### Delete File -Action to delete file by provided full file path.If the file does not exist, the empty message (`{}`) is returned - -#### Configuration Fields -none - -#### Input Metadata -- **Full Path** - (string, required): Full filename and path to the file - -#### Output Metadata -- **id** - (string, required): Full filename and path to the file - -### Download File by name -Finds a file by name in the provided directory and either uploads (streams) its content to the attachment storage or emits its in Base64 representation as a message. - -#### Configuration Fields -* **Allow Empty Result** - (dropdown, optional, defaults to `No`): Do not throw an error when no objects were found -* **Allow ID to be Omitted** - (dropdown, optional, defaults to `No`): Do not throw an error when object id is missing -* **Emit file content (Base64)** - (checkbox, optional, defaults to `No`): When checked, a file will not be put into the internal storage. The file content in Base64 representation will be emitted as a part of the message. - **Be careful:** Maximum message size supported on the platform is 10MB. This is why files bigger than 10MB will not be processed. - -#### Input Metadata -- **Path and File Name** - (string, required if `Allow ID to be Omitted` set to `No`): Full filename and path to the file - -#### Output Metadata -* **type** - (string, required): File type -* **name** - (number, required): File name -* **size** - (number, required): File size -* **owner** - (number, required): User identifier -* **group** - (number, required): Group identifier -* **accessTime** - (string, required): Last Access Time -* **modifyTime** - (string, required): Last Modify Time -* **rights** - (object, required): Rights to file on SFTP server -* **directory** - (string, required): Directory -* **path** - (string, required): Full Path -* **attachment_url** - (string, required): Url to file in storage. This field will always be empty if the checkbox `Emit file content (Base64)` is checked -* **base64Content** - (string, optional): Base64 file content - -### Download Files -Finds files by criteria in the provided directory and either uploads (streams) their content to the attachment storage or emits it in Base64 representation as a message. - -#### Configuration Fields -* **Behavior** - (dropdown, required): Defines the way result objects will be emitted - * **Fetch All** - All objects will be emitted as array in one object with key `results` - * **Emit Individually** - Each object will be emitted separately filling the entire message -* **Number of search terms** - (number, optional, between 0 and 99): Defines the number of search terms that the entity must match -* **Upload files to attachment** - (dropdown, optional): If set to `Yes` files will be uploaded to platform storage -* **File Upload Retry** - (number, optional, default 5): How many times to retry file upload as attachment to platform storage -* **Retry Timeout** - (number, optional, default 10000): How long to wait between retry attempts in milliseconds -* **File Upload Timeout** - (number, optional, default 10000): If a file upload process is longer than the specified number of milliseconds and is not processing any data (receiving or uploading), the timeout will be thrown (the process will be retried if \"File Upload Retry\" set) -* **Emit File Content (Base64)** - (checkbox, optional, defaults to `No`): When checked, the file will not be stored internally. Instead, its content will be emitted as part of the message, encoded in Base64. - * **Note**: The maximum supported message size on the platform is 10MB. Files larger than 10MB will not be processed. - * **Important**: This checkbox functions differently from the `Download File by Name` action. In the latter, file content is either attached to the message or emitted within the message body. However, in this action, the output depends on both this checkbox and the `Upload Files to Attachment` dropdown. The combination of these two fields can result in one of four outcomes: - * Upload file to attachment. Emit file content as a message. - * Upload file to attachment. Do not emit file content as a message. - * Do not upload file to attachment. Emit file content as a message. - * Do not upload file to attachment. Do not emit file content as a message. - - -#### Input Metadata -* **Directory Path** - (string, required): The directory of the files to read from -* **Max Size** - (number, optional, defaults to 250): Maximum number of objects to fetch -* **Search term** - (object, required and appears if `Number of search terms` > 0): Criteria of the file to search: - * **Field Name** - (string, required): options are: - * **name** - File name - * **modifyTime** - Last Modify Time - * **accessTime** - Last Access Time - * **size** - File size - * **Condition** - (string, required): options are: - * **like** - like - * **eq** - equal - * **ne** - not equal - * **gt** - greater than - * **gte** - greater than or equal - * **lt** - less than - * **lte** - less than or equal - * **Field Value** - (string, required): Value for selected term -* **Criteria Link** - (string, required and appears if `Number of search terms` > 1): Determinate how to combine `Search terms`: - * **and** - All search term match - * **or** - One or more search terms match - -#### Output Metadata -* **type** - (string, required): File type -* **name** - (number, required): File name -* **size** - (number, required): File size -* **owner** - (number, required): User identifier -* **group** - (number, required): Group identifier -* **accessTime** - (string, required): Last Access Time -* **modifyTime** - (string, required): Last Modify Time -* **rights** - (object, required): Rights to file on SFTP server -* **directory** - (string, required): Directory -* **path** - (string, required): Full Path -* **attachment_url** - (string, optional): Url to file in storage. This field exists if the `Upload files to attachment` configuration set to true -* **base64Content** - (string, optional): Base64 file content -* -### Move File - -Action to move file on SFTP already exists in one location on an sftp server to be moved to another location on the same SFTP server. -Target location MUST exist. If the target filename already exists it will be overwritten. This action uses the openssh POSIX rename extension introduced in OpenSSH 4.8 if it is available. The advantage of this version of rename over standard SFTP rename is that it is an atomic operation and will allow renaming a resource where the destination name exists. If the openssh POSIX rename mechanism is not available, then a delete operation and then rename operation will be completed. - -#### Configuration Fields - -none - -#### Input Metadata - -- **Current file Name and Path** - (string, required): Full filename and path to the file -- **New file Name and Path** - (string, required): Full filename and path to the file to move - -#### Output Metadata - -- **filename** - (string, required): Full filename and path to the file where it was -- **newFilename** - (string, required): Full filename and path to the file where is moved - -### Upload File From URL - -Given a filename and a URL to an attachment, transfers the contents of the attachment to the SFTP server - -#### Configuration Fields - -* **Behavior When File Already Exists** - (dropdown, required): The expected behavior of the component when trying to write to a file that already exists: - * **Throw an Error**: Does not write data to the file and the component produces an error - * **Overwrite the File**: Replace the existing file contents with the contents of the attachment stored in the platform. - * **Append the File Contents**: Adds the contents of the attachment stored in the platform to the end of the file. No intermediate characters (e.g. newlines or spaces) will be added. - -Note: If the filename provided contains directories that do not exist, those directories will be created. - -#### Input Metadata - -- **File Name and Path** - (string, required): Full filename and path to the file to write. Both absolute (e.g. `/home/myuser/somefolder/some.file`) and relative (e.g. `./somefolder/some.file`) paths are supported. Tilde (`~`) expansion is not supported. -- **Attachment URL** - (string, required): URL of the stored attachment to store in the file. -- **Encoding** - (string, optional): The encoding (if any) that should be applied to the written file. -- **File Mode** - (string/number, optional): The read/write/execute permissions for the file, defaults to 00666 (rwx) - -#### Output Metadata - -* **mode** - (number, required): permissions for the file -* **size** - (number, required): File Size -* **uid** - (number, required): User identifier -* **gid** - (number, required): Group identifier -* **accessTime** - (string, required): Last Access Time -* **modifyTime** - (string, required): Last Modify Time -* **isDirectory** - (boolean, required): Is it directory -* **isFile** - (string, required): Is it file - - -### Upload Files From Attachments Header - -#### Configuration Fields +SFTP component includes the following actions: -- **Directory** - (string, required): The directory where the file will be uploaded to, if the directory does not exist, it will create it at the risk of possibly overwriting any files that may have the same name. +1. [Delete file](actions#delete-file) - Action to delete file by provided full file path. +2. [Download File by name](actions#download-file-by-name) - Finds a file by name in the provided directory and uploads (streams) to the attachment storage. +3. [Download Files](actions#download-files) - Finds a file by criteria in the provided directory and uploads (streams) to the attachment storage. +4. [Move file](actions#move-file) - Action to move file on SFTP already exists in one location on an sftp server to be moved to another location on the same SFTP server. +5. [Upload File From URL](actions#upload-file-from-url) - Given a filename and a URL to an attachment, transfers the contents of the attachment to the SFTP server. +6. [Upload Files From Attachments Header](actions#upload-files-from-attachments-header) - Upload all files from the attachments header to a defined SFTP directory. -#### Input Metadata +## Known limitations -* **Filename** - (string, optional): Custom name for uploaded file - * **Note 1** Uploaded file name will get filename of income file if new `Filename` doesn't provided - * **Note 2** `Filename` will be added at the beggining of attachment name if income message contains multiple attachments: `[SpecifiedFilename]_[NameOfExistedFile]` - * **Note 3** File will be overwritten in case when file with specified name already exists in directory +* The attachments mechanism does not work with [Local Agent Installation](/guides/vpn-agent). -#### Output Metadata -An object, with key `results` that has an array as its value +## Related links -* **attachment** - (string, required): File Name -* **uploadedOn** - (string, required): Upload datetime -* **path** - (string, required): Full Path to file +* The SFTP component uses [ssh2-sftp-client](https://www.npmjs.com/package/ssh2-sftp-client). +* Explanation of [Unix file types](https://en.wikipedia.org/wiki/Unix_file_types). diff --git a/content/_components/sftp/triggers.md b/content/_components/sftp/triggers.md new file mode 100644 index 00000000..fd9e76e4 --- /dev/null +++ b/content/_components/sftp/triggers.md @@ -0,0 +1,68 @@ +--- +title: SFTP triggers +layout: component +description: SFTP component triggers. +icon: sftp.png +icontext: SFTP component +category: sftp +updatedDate: 2024-03-01 +ComponentVersion: 1.7.0 +--- + +## Poll Files + +Triggers to get all new and updated files since last polling. + +> **Plesae Note:** To gain a better understanding of the functionality provided by Poll Files trigger, we recommend checking out our [example article](/components/sftp/usage-example#poll-files). It provides a detailed walkthrough of how to use Poll Files trigger effectively, which will assist you in working with it. + +{% include img.html max-width="100%" url="img/pool-files.png" title="Poll Files" %} + +### Configuration Fields + +* **Directory** - (string, required): The directory of the files to read from +* **Emit Behaviour** - (dropdown, optional): Defines the way result objects will be emitted, defaults to `Emit individually` + * **Fetch All** - All objects will be emitted as array in one object with key `results` + * **Emit Individually** - Each object will be emitted separately filling the entire message +* **Start Time** - (string, optional): Start datetime of polling, defaults to`-271821-04-20T00:00:00.000Z` +* **End Time** - (string, optional): End datetime of polling, defaults to `+275760-09-13T00:00:00.000Z` +* **Pattern** - (string, optional): Regex pattern for file names. If no pattern is given, no matching is done + +### Output Metadata + +* **filename** - (string, required): File Name +* **size** - (number, required): File Size +* **type** - (string, required): File Type +* **modifyTime** - (string, required): Last Modification Time +* **accessTime** - (string, required): Last Access Time +* **directory** - (string, required): Directory +* **path** - (string, required): Full Path + +### Known limitations + +* Trigger mechanism is based on SFTP file `modifyTime` metadata field. For correct processing the trigger requires correct time configuration on the SFTP server. + +## Read files(Deprecated) + +>**Please Note:** This trigger is deprecated, please use Poll Files trigger instead + +Will continuously poll remote SFTP location for files that match given pattern. Found files will be transferred as attachments to the next component + +After a file is found: + * It is moved to the (hidden) directory `.elasticio_processed` and to name of the file will be added timestamp, ex.: file `test.txt` will be renamed to `test.txt_1657621889133` + * It is pulled and uploaded (streamed) to the attachment storage + +>**Please Note:** you may need to consider cleaning up the `.elasticio_processed` directory manually + +### Configuration Fields + +* **Directory** - (string, required): The directory of the files to read from +* **Pattern** - (string, optional): Regex pattern for file names. If no pattern is given, no matching is done. + +### Input Metadata + +There is no Input Metadata + +### Output Metadata + +* **filename** - (string, required): Name of the file +* **size** - (number, required): File size diff --git a/content/_components/shopify-admin-v2/index.md b/content/_components/shopify-admin-v2/index.md index 032e6c75..59333f52 100644 --- a/content/_components/shopify-admin-v2/index.md +++ b/content/_components/shopify-admin-v2/index.md @@ -10,159 +10,281 @@ updatedDate: 2024-09-05 ComponentVersion: 2.5.0 --- -# Shopify admin Component - -## Table of Contents - -* [Description](#description) -* [Credentials](#credentials) -* [Actions](#actions) - * [Delete Object](#delete-object) - * [Create Object](#create-object) - * [Update Object](#update-object) - * [Upsert Object](#upsert-object) - * [Execute mutation](#execute-mutation) - * [Lookup Objects (plural)](#lookup-objects-plural) - * [Lookup Object By ID](#lookup-object-by-id) - * [Make Raw Request](#make-raw-request) -* [Triggers](#triggers) - * [Get New and Updated Objects Polling](#get-new-and-updated-objects-polling) - * [Webhook](#webhook) -* [Known Limitations](#known-limitations) - ## Description -Shopify admin Component is designed to connect to Shopify [GraphQL](https://shopify.dev/api/admin-graphql) Admin API +Shopify admin Component is designed to connect to Shopify [GraphQL](https://shopify.dev/api/admin-graphql) Admin API. -Tested with API version: `2023-01` +Tested with API version: `2023-01`. ## Credentials To use this component you need to create a custom App: -1. Go to your store [Admin panel](https://accounts.shopify.com/store-login) -2. Open `App and sales channel settings` -3. Select `Develop apps for your store` -4. Then `Create an app` button -5. Provide any app name and press `Create app` -6. Follow to `Configure Admin API scopes` -7. Select access scopes - Objects, that component will have access to and press `Save` -8. Now you be able to install this app by pressing `Install app` button in `API credentials` section or in right upper corner -9. Finally you can get `Admin API access token` by selecting `Reveal token once`. It will be needed in component credentials configuration -10. In addition, you may need to save `API secret key` if you going to use webhooks - -Screenshot instructions - -![image](https://user-images.githubusercontent.com/7985390/212651871-ec4b3a9c-796d-426a-b0f6-3211158eb8fd.png) -![image](https://user-images.githubusercontent.com/7985390/212652427-7ad69efe-b0dc-43d8-9ee7-0644dc6c3eca.png) -![image](https://user-images.githubusercontent.com/7985390/212652928-43d652bf-ffa7-41d8-93c1-8be51651ac51.png) -![image](https://user-images.githubusercontent.com/7985390/212653313-3118a627-8e98-4fa6-8ea4-d71d2e4cf4c2.png) -![image](https://user-images.githubusercontent.com/7985390/212653733-cddae330-d291-4d53-a49b-fc021d804d90.png) -![image](https://user-images.githubusercontent.com/7985390/212654589-0527a2ce-0b60-4cf7-875f-5d599cf580a8.png) -![image](https://user-images.githubusercontent.com/7985390/212654890-3d25d9fb-55db-45f7-bcd0-5b991d78c7c7.png) -![image](https://user-images.githubusercontent.com/7985390/212655979-354a7e97-536c-4cc0-82bf-aeccb279f96a.png) - +1. Go to your store [Admin panel](https://accounts.shopify.com/store-login). +2. Open `App and sales channel settings`. +3. Select `Develop apps for your store`. +4. Then `Create an app` button. +5. Provide any app name and press `Create app`. +6. Follow to `Configure Admin API scopes`. +7. Select access scopes - Objects, that component will have access to and press `Save`. +8. Now you be able to install this app by pressing `Install app` button in `API credentials` section in the right upper corner. +9. Finally you can get `Admin API access token` by selecting `Reveal token once`. It will be needed in the component credentials configuration. +10. In addition, you may need to save `API secret key` if you going to use webhooks. + +
Screenshot instructions + +![Instruction 1](img/shopify-admin-v2-instructions-1.png) +![Instruction 2](img/shopify-admin-v2-instructions-2.png) +![Instruction 3](img/shopify-admin-v2-instructions-3.png) +![Instruction 4](img/shopify-admin-v2-instructions-4.png) +![Instruction 5](img/shopify-admin-v2-instructions-5.png) +![Instruction 6](img/shopify-admin-v2-instructions-6.png) +![Instruction 7](img/shopify-admin-v2-instructions-7.png) +![Instruction 8](img/shopify-admin-v2-instructions-8.png) + +
Component credentials configuration fields: -* **Store name** (string, required) - Provide you store name here, can be found in [Admin panel](https://accounts.shopify.com/store-login) as a part of store url ![image](https://user-images.githubusercontent.com/7985390/212658330-bd1789dd-e7b6-4afb-ae0c-63464a773eb1.png) + +* **Store name** (string, required) - Provide you store name here, can be found in [Admin panel](https://accounts.shopify.com/store-login) as a part of store URL. + +![Store Name](img/store-name.png) + * **Admin API access token** (string, required) - this token you will get after app creation (look at instructions above) -* **API version** (string, required) - Provide API version you are going to work with. Currently component tested on `2023-01`, but should work with any available -* **API secret key** (string, optional) - This field is used and required **only** for trigger - `Webhook` to [sign the request with an HMAC header](https://shopify.dev/apps/webhooks/configuration/https#step-5-verify-the-webhook). -## Notes: -* `Admin API access token` shows only once -* To rotate the API credentials for a custom app that was created in the Shopify admin, you need to uninstall and reinstall the app +* **API version** (string, required) - Provide the API version you are going to work with. The component has been tested on `2023-01`, but should work with any available. +* **API secret key** (string, required) - This field is used and required **only** for trigger - `Webhook` to [sign the request with an HMAC header](https://shopify.dev/apps/webhooks/configuration/https#step-5-verify-the-webhook). -## Actions +> **Notes:** +* `Admin API access token` shows only once. +* To rotate the API credentials for a custom app that was created in the Shopify admin, you need to uninstall and reinstall the app. -### Delete Object +## Triggers -Objects in Shopify can be deleted with [Execute mutation action](#execute-mutation) +### Webhook +Creates [webhook subscription](https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/webhookSubscriptionCreate) for selected topics on the Shopify side to receive events. -To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Delete` or `Remove` keyword +#### Configuration Fields -![image](https://user-images.githubusercontent.com/7985390/219295785-04e58f75-3ee5-476f-8c9d-96e6784e7a19.png) +* **Select topics** - (multi-select dropdown, required): Select available topics to create a subscription. +* **Skip validation** - (checkbox, optional): If checked - the component will not validate the incoming message to be sure that it comes from Shopify, use it for test purposes only! -In most cases you will get one input metadata field with object identifier -![image](https://user-images.githubusercontent.com/7985390/219296219-32cdf0d0-b246-46d3-8610-a33acef6e651.png) +#### Input Metadata - Example of input metadata to delete a customer +There is no input metadata. +#### Output Metadata +Event from the subscription on the selected topic. - ``` json - { - "input": { - "id": "gid://shopify/Customer/6657016299696" - } - } - ``` +#### Limitations +* **Generate Stub Sample** works only for the most used objects. +* This trigger doesn't support `Retrieve sample` functionality. +* If you use ordinary flow (The `Real-time` functionality not enabled) after flow starts you will need to run it once - just follow the webhook URL (to make the first execution) this action will create a subscription, error on this execution may be ignored. - Example of input metadata to delete multiple companies +### Get New and Updated Objects Polling - ``` json - { - "companyIds": ["gid://shopify/Company/68616368"] - } - ``` +Retrieve all the updated or created objects within a given time range. - Example of input metadata to bulk delete draft orders using search +#### Configuration Fields - ``` json +* **Object Type** - (dropdown, required): Object-type to lookup on. E.g `Customers`. + +* **Timestamp field to poll on** - (dropdown, required): Can be either `Last Modified` or `Created dates` (updated or new objects, respectively). + +* **Select basic fields for resulting object** - (dropdown, optional): Here only basic fields that can be included in the resulting object, may affect query cost. + +* **You can provide additional fields here** - (string, optional): The resulting object can be expanded using GraphQL request, this field represents content from each `edges.node`, it may affect on query cost. + +* **Size of Polling Page** - (optional, positive integer, defaults to 250, max 250): Indicates the size of pages to be fetched per request. If you query cost will be over shop limit, you can decrease page size. + +* **Emit behavior** - (dropdown, optional): Indicates emit objects behavior - `Emit individually` (by default) or `Emit page` + +* **Return Full Response** - (checkbox): Defines the format of emitted result: with service information or without. + Examples for Object type `customers` are given below: + +
Example for customer + + ```graphql + metafields(first: 2) { + edges { + node { + namespace + key + value + } + } + } + addresses { + address1 + country + } + ``` + +
+ +
Response with enabled "Return Full Response" checkbox and "Emit Behavior" = "Emit page" + +```json { - "search": "query=name:\"#D12\"" + "data": { + "customers": [ + { + "id": "gid://shopify/Customer/2444144115794", + "firstName": "Willy" + }, + { + "id": "gid://shopify/Customer/2444144148562", + "firstName": "Tobi" + }, + { + "id": "gid://shopify/Customer/2444144181330", + "firstName": "Mathilde" + } + ] + }, + "extensions": { + "cost": { + "requestedQueryCost": 5, + "actualQueryCost": 5, + "throttleStatus": { + "maximumAvailable": 1000, + "currentlyAvailable": 40, + "restoreRate": 50 + } + } + } } - ``` +``` +
-### Create Object +
Response with disabled "Return Full Response" checkbox and "Emit Behavior" = "Emit page" -Objects in Shopify can be created with [Execute mutation action](#execute-mutation) +```json +{ + "results": [ + { + "id": "gid://shopify/Customer/2444144115794", + "firstName": "Willy" + }, + { + "id": "gid://shopify/Customer/2444144148562", + "firstName": "Tobi" + }, + { + "id": "gid://shopify/Customer/2444144181330", + "firstName": "Mathilde" + } + ] +} +``` +
-To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Create` keyword +#### Input Metadata -![image](https://user-images.githubusercontent.com/7985390/219297221-87962b48-16ed-4a8b-9fe3-8e2c1fce7e9d.png) +There is no input metadata. -Input metadata will represent all needed fields to create an object +#### Output Metadata +Resulting object will represent content from path `data\\{Object Type}\\edges\node`. - Example of input metadata to create a customer +Depends on selected `Object Type`, selected or provided fields and `Emit behavior`: +- For `Emit Page` mode: + - An object with key `results` that has an array as its value (if `Page Size` > 0) +- For `Emit Individually` mode: + - Each object which fill the entire message. +## Actions - ``` json - { - "input": { - "firstName": "NewUser" - } +### Delete Object + +Objects in Shopify can be deleted with [Execute mutation action](#execute-mutation). + +To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Delete` or `Remove` keyword. + +![Delete Object 1](img/delete-object-1.png) + +In most cases you will get one input metadata field with object identifier. + +![Delete Object 2](img/delete-object-2.png) + +
Example of input metadata to delete a customer + +``` json +{ + "input": { + "id": "gid://shopify/Customer/6657016299696" } - ``` +} +``` +
+
Example of input metadata to delete multiple companies -### Update Object +``` json +{ + "companyIds": ["gid://shopify/Company/68616368"] +} +``` +
+ +
Example of input metadata to bulk delete draft orders using search + +```json +{ + "search": "query=name:\"#D12\"" +} +``` + +
+ +### Create Object + +Objects in Shopify can be created with [Execute mutation action](#execute-mutation). -Objects in Shopify can be updated with [Execute mutation action](#execute-mutation) +To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Create` keyword. -To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Update` keyword +![Create Object](img/create-object-1.png) -![image](https://user-images.githubusercontent.com/7985390/219297654-ba6b36cb-e465-4a7e-b797-ee9717788bff.png) +Input metadata will represent all needed fields to create an object. -Input metadata will represent all needed fields to update an object +
Example of input metadata to create a customer +``` json +{ + "input": { + "firstName": "NewUser" + } +} +``` + +
- Example of input metadata to update a customer +### Update Object +Objects in Shopify can be updated with [Execute mutation action](#execute-mutation). + +To do that, filter the list of available mutation types in the `Mutation type` configuration field by `Update` keyword. + +![Update Object](img/update-object-1.png) + +Input metadata will represent all needed fields to update an object. + +
Example of input metadata to update a customer ``` json - { - "input": { - "firstName": "NewUser2", - "id": "gid://shopify/Customer/6664472461488" - } +{ + "input": { + "firstName": "NewUser2", + "id": "gid://shopify/Customer/6664472461488" } - ``` +} +``` +
-### Upsert Object +### Upsert Object Updates (of record found) or creates a new object. @@ -171,9 +293,8 @@ Updates (of record found) or creates a new object. * **Object type** - (dropdown, required): Currently supported only `Customers`. * **Unique field to upsert** - (dropdown, required): This field will be used to search object, if object not found or field is empty, new object will be created. * **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost -* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost - Example for customer - +* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost. +Example for customer: ``` customer { addresses { @@ -181,8 +302,7 @@ Updates (of record found) or creates a new object. } } ``` - - ❗Note: You need to select basic fields or provide additional fields for resulting object to execute mutation +> **Please Note**: You need to select basic fields or provide additional fields for resulting object to execute mutation * **Input as batch** - (checkbox, optional): If checked, the input metadata will be an array instead of a single object #### Input Metadata @@ -191,20 +311,21 @@ Dynamically generated fields according to chosen `Object type`. #### Output Metadata -Result object from upsert. +Result object from upsert. ### Execute mutation -Execute any mutation available on selected API version. This action can be used to `Create`, `Update` or `Delete` Objects and any other operations that affect on Shopify data +Execute any mutation available on selected API version. This action can be used to `Create`, `Update` or `Delete` Objects and any other operations that affect on Shopify data. #### Configuration Fields * **Mutation type** - (dropdown, required): Mutation type to execute. E.g `Customer Create`. -* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost -* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost - Example for customer +* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost. +* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost. - ``` +
Example for customer + +```graphql customer { metafields(first: 2) { edges { @@ -220,9 +341,11 @@ Execute any mutation available on selected API version. This action can be used country } } - ``` +``` -❗Note: You need to select basic fields or provide additional fields for resulting object to execute mutation +
+ +>**Please Note:** You need to select basic fields or provide additional fields for resulting object to execute mutation #### Input Metadata @@ -239,92 +362,98 @@ Lookup a set of objects by defined criteria list. Can be emitted in different wa #### Configuration Fields * **Object Type** - (dropdown, required): Object-type to lookup on. E.g `Customers`. -* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost -* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost - Example for customer +* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost. +* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost. +* **Emit Behavior** - (dropdown, required): Defines the way result objects will be emitted, one of `Emit page` or `Emit individually`. +* **Return Full Response** - (checkbox): Defines the format of emitted result: with service information or without. +Examples for Object type `customers` are given below: - ``` - addresses { +
Example for customer + + ```graphql + addresses { address1 country - } - ``` + } + ``` -* **Emit Behavior** - (dropdown, required): Defines the way result objects will be emitted, one of `Emit page` or `Emit individually`. -* **Return Full Response** - (checkbox): Defines the format of emitted result: with service information or without. -Examples for Object type `customers` are given below: - Response with enabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` - - ```json - { - "data": { - "customers": [ - { - "id": "gid://shopify/Customer/2444144115794", - "firstName": "Willy" - }, - { - "id": "gid://shopify/Customer/2444144148562", - "firstName": "Tobi" - }, - { - "id": "gid://shopify/Customer/2444144181330", - "firstName": "Mathilde" - } - ] - }, - "extensions": { - "cost": { - "requestedQueryCost": 5, - "actualQueryCost": 5, - "throttleStatus": { - "maximumAvailable": 1000, - "currentlyAvailable": 40, - "restoreRate": 50 - } +
+ +
Response with enabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` + +```json +{ + "data": { + "customers": [ + { + "id": "gid://shopify/Customer/2444144115794", + "firstName": "Willy" + }, + { + "id": "gid://shopify/Customer/2444144148562", + "firstName": "Tobi" + }, + { + "id": "gid://shopify/Customer/2444144181330", + "firstName": "Mathilde" + } + ] + }, + "extensions": { + "cost": { + "requestedQueryCost": 5, + "actualQueryCost": 5, + "throttleStatus": { + "maximumAvailable": 1000, + "currentlyAvailable": 40, + "restoreRate": 50 } } - } - ``` + } +} +``` +
- Response with disabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` - - ```json - { - "results": [ - { - "id": "gid://shopify/Customer/2444144115794", - "firstName": "Willy" - }, - { - "id": "gid://shopify/Customer/2444144148562", - "firstName": "Tobi" - }, - { - "id": "gid://shopify/Customer/2444144181330", - "firstName": "Mathilde" - } - ] - } - ``` +
Response with disabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` + +```json +{ + "results": [ + { + "id": "gid://shopify/Customer/2444144115794", + "firstName": "Willy" + }, + { + "id": "gid://shopify/Customer/2444144148562", + "firstName": "Tobi" + }, + { + "id": "gid://shopify/Customer/2444144181330", + "firstName": "Mathilde" + } + ] +} +``` +- **Number of search terms** - (number, optional): text field to specify the number of search terms (positive integer number [1-99] or 0). +- **Emit empty object if no entities found** - (checkbox): If this checkbox is selected and objects are not found component will emit an empty object instead of skipping execution -* **Number of search terms** - (number, optional): text field to specify the number of search terms (positive integer number [1-99] or 0). -* **Emit empty object if no entities found** - (checkbox): If this checkbox is selected and objects are not found component will emit an empty object instead of skipping execution +
#### Input Metadata -* **First** - (strings, optional): Indicates amount of objects per execution. Default to 250 +* **First** - (strings, optional): Indicates amount of objects per execution. Default to 250. Input Metadata is depending on the configuration field `Number of search terms`. If `Number of search terms` is empty or equal `0`, additional fields will not be generated. If `Number of search terms` = 1, one search term will be added to metadata. If `Number of search terms` > 1, a number of search term equal `Number of search terms` and a number of criteria link equal 'Number of search terms - 1' will de created in metadata. Each search term has 3 fields: -* **Field name** - chosen entity's field name. You need to select the one field from Allowed Values section - **Note** Allowed Values section contains fields that are allowed to use in query and fields with `-` sign, which means `NOT` modifier (see [here](https://shopify.dev/docs/api/usage/search-syntax#modifiers)) -* **Condition** - You need to select the one condition from Allowed Values section -* **Field value** - the value that the field must match with the specified condition + - **Field name** - chosen entity's field name. You need to select the one field from Allowed Values section + >**Please Note:** Allowed Values section contains fields that are allowed to use in query and fields with `-` sign, which means `NOT` modifier (see [here](https://shopify.dev/docs/api/usage/search-syntax#modifiers)). + + - **Condition** - You need to select the one condition from Allowed Values section + - **Field value** - the value that the field must match with the specified condition Between search terms, there is Criteria Link. You need to select the one criteria from Allowed Values section @@ -335,8 +464,10 @@ For `Emit Page` mode: An object, with key `results` that has an array as its val For `Emit Individually` mode: Each object which fill the entire message. #### Example + For instance, it is needed to execute following Shopify query: -``` + +```graphql query{ customers(first:10 query:"country:Canada AND -state:DISABLED"){ edges{ @@ -352,48 +483,46 @@ query{ } } ``` -1. Select in `Object type` option `Customers` - image - -2. From dropdown `Select basic fields for resulting object` select basic fields: `id`, `state` and `firstName`. - image - -**Note**: Basic fields are fields that can be requested without specifying arguments or adding additional levels: `id`, `email`, etc. -3. Paste additional fields in field `You can provide additional fields here`: - image +**1.** Select in `Object type` option `Customers`. +{% include img.html max-width="100%" url="img/example-1.png" title="Example 1" %} -**Note**: Additional fields are fields that can't be selected in `Basic fields` section. As rule, they are fields with specifying arguments or adding additional levels such as: `addresses{country}`. +**2.** From dropdown `Select basic fields for resulting object` select basic fields: `id`, `state` and `firstName`. +{% include img.html max-width="100%" url="img/example-2.png" title="Example 2" %} +>**Please Note**: Basic fields are fields that can be requested without specifying arguments or adding additional levels: `id`, `email`, etc. -4. Select `Emit Behavior`. If it is needed to receive each object individually, use `Emit individually`, in other case, `Emit page` option - all objects will be returned in one array `result`. For example, lets use 'Emit individually' - image +**3.** Paste additional fields in field `You can provide additional fields here`: +{% include img.html max-width="100%" url="img/example-3.png" title="Example 3" %} +> **Please Note**: Additional fields are fields that can't be selected in `Basic fields` section. As rule, they are fields with specifying arguments or adding additional levels such as: `addresses{country}`. -5. Specify `Number of search terms`: in example query we see 2 conditions, so set it to `2` - image +**4.** Select `Emit Behavior`. If it is needed to receive each object individually, use `Emit individually`, in other cases, `Emit page` option - all objects will be returned in one array `result`. For example, lets use `Emit individually`. +{% include img.html max-width="100%" url="img/example-4.png" title="Example 4" %} -6. Push the button `Continue` and move to fill metadata +**5.** Specify `Number of search terms`: in example query we see 2 conditions, so set it to `2`. +{% include img.html max-width="100%" url="img/example-5.png" title="Example 5" %} -7. Set `10` to field `First` - image +**6.** Push the button `Continue` and move to fill metadata. -8. To map condition `country:Canada`: +**7.** Set `10` to field `First`. +{% include img.html max-width="100%" url="img/example-6.png" title="Example 6" %} -- select in `Field name` from Allowed Values dropdown option `country`: - image +**8.** To map condition `country:Canada`: +- Select in `Field name` from Allowed Values dropdown option `country`: +{% include img.html max-width="100%" url="img/example-7.png" title="Example 7" %} +- Select in `Condition` from Allowed Values dropdown option `:`. +- Set in `Field value` value `Canada`. +{% include img.html max-width="100%" url="img/example-8.png" title="Example 8" %} -- select in `Condition` from Allowed Values dropdown option `:` -- set in `Field value` value `Canada` +**9.** Select in `Logical operator` from Allowed Values dropdown option `AND`. -image +**10.** To map condition `-state:DISABLED`: set `Field name` to `-state`, `Condition` to `:` and `Field value` to `DISABLED`. +{% include img.html max-width="100%" url="img/example-9.png" title="Example 9" %} -9. Select in `Logical operator` from Allowed Values dropdown option `AND` -10. To map condition `-state:DISABLED`: set `Field name` to `-state`, `Condition` to `:` and `Field value` to `DISABLED` +**11.** Push the button `Continue` and move to `Sample` section. -image +**12.** Push the button `Retrieve new sample from Shopify admin component v2`. -11. Push the button `Continue` and move to `Sample` section -12. Push the button `Retrieve new sample from Shopify admin component v2` -13. Step is configured. +**13.** Step is configured. ### Lookup Object By ID @@ -402,19 +531,21 @@ Lookup a single object by its ID - only query with one argument `id` can be used #### Configuration Fields * **Object Type** - (dropdown, required): Object-type to lookup on. E.g `Customer`. -* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost -* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost - Example for customer +* **Select basic fields for resulting object** - (dropdown, optional): Here only basic fields can be included in the resulting object, it may affect query cost. +* **You can provide additional fields here** - (string, optional): The resulting object can be expanded using GraphQL request, it may affect query cost. - ``` - addresses { - address1 - country - } +
Example for customer + + ```graphql + addresses { + address1 + country + } ``` +
-image +{% include img.html max-width="100%" url="img/lookup-by-id.png" title="Lookup Object By ID" %} #### Input Metadata @@ -430,11 +561,11 @@ Executes custom request. #### Configuration Fields -none +There is no configuration fields in this action. #### Input Metadata -* **Url** - (string, required): Path of the resource relative to the base URL (`https://{store_name}.myshopify.com/admin/api/{api_version}/`) or full url +* **URL** - (string, required): Path of the resource relative to the base URL (`https://{store_name}.myshopify.com/admin/api/{api_version}/`) or full URL * **Method** - (string, required): HTTP verb to use in the request, one of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`. * **Request Body** - (object, optional): Body of the request to send. @@ -444,154 +575,21 @@ none * **HTTP headers** - (object, required): HTTP headers of the response. * **Response Body** - (object, optional): HTTP response body. -**Note**: GraphQL and REST API endpoints are supported. E.g. - -GraphQL - -* **Url** - `/graphql.json` -* **Method** - `POST` -* **Request Body** - `{"query": "query { products(first: 10) { edges { node { id title } } } }"}` - -Equivalent to this: - -REST - -* **Url** - `/products.json?fields=id,title` -* **Method** - `POST` -* **Request Body** - *empty - -## Triggers - -### Get New and Updated Objects Polling - -Retrieve all the updated or created objects within a given time range. - -#### Configuration Fields - -* **Object Type** - (dropdown, required): Object-type to lookup on. E.g `Customers`. - -* **Timestamp field to poll on** - (dropdown, required): Can be either Last Modified or Created dates (updated or new objects, respectively) - -* **Select basic fields for resulting object** - (dropdown, optional): Here provided only basic fields that can be included in resulting object, it may affect on query cost -* **You can provide additional fields here** - (string, optional): Resulting object can be expanded using GraphQL request, this field represent content from each `edges.node`, it may affect on query cost - Example for Customers - - ``` - metafields(first: 2) { - edges { - node { - namespace - key - value - } - } - } - addresses { - address1 - country - } - ``` - -* **Size of Polling Page** - (optional, positive integer, defaults to 250, max 250): Indicates the size of pages to be fetched per request. If you query cost will be over shop limit, you can decrease page size. -* **Emit behavior** - (dropdown, optional): Indicates emit objects behavior - `Emit individually` (by default) or `Emit page` -* **Return Full Response** - (checkbox): Defines the format of emitted result: with service information or without. - Examples for Object type `customers` are given below: -Response with enabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` - -```json -{ - "data": { - "customers": [ - { - "id": "gid://shopify/Customer/2444144115794", - "firstName": "Willy" - }, - { - "id": "gid://shopify/Customer/2444144148562", - "firstName": "Tobi" - }, - { - "id": "gid://shopify/Customer/2444144181330", - "firstName": "Mathilde" - } - ] - }, - "extensions": { - "cost": { - "requestedQueryCost": 5, - "actualQueryCost": 5, - "throttleStatus": { - "maximumAvailable": 1000, - "currentlyAvailable": 40, - "restoreRate": 50 - } - } - } -} -``` - - -Response with disabled `Return Full Response` checkbox and `Emit Behavior` = `Emit page` +> **Note:** GraphQL and REST endpoints are supported. You can find examples below. -```json -{ - "results": [ - { - "id": "gid://shopify/Customer/2444144115794", - "firstName": "Willy" - }, - { - "id": "gid://shopify/Customer/2444144148562", - "firstName": "Tobi" - }, - { - "id": "gid://shopify/Customer/2444144181330", - "firstName": "Mathilde" - } - ] -} -``` - - -* **Start Time** - (string, optional): The timestamp, in ISO8601 format, to start polling from (inclusive). Default value is the beginning of time (January 1, 1970 at 00:00.000). -* **End Time** - (string, optional): The timestamp, in ISO8601 format, to end at (inclusive). Default value is never. - - -#### Input Metadata - -None. - -#### Output Metadata -Resulting object will represent content from path "data\\{Object Type}\\edges\node" - -Depends on selected `Object Type`, selected or provided fields and `Emit behavior`: -For `Emit Page` mode: An object with key `results` that has an array as its value (if `Page Size` > 0) -For `Emit Individually` mode: Each object which fill the entire message. - - -### Webhook - -Creates [webhook subscription](https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/webhookSubscriptionCreate) for selected topics on the Shopify side to receive events +#### GraphQL +* **URL** - `/graphql.json`. +* **Method** - `POST`. +* **Request Body** - `{"query": "query { products(first: 10) { edges { node { id title } } } }"}`. -#### Configuration Fields - -* **Select topics** - (multi-select dropdown, required): Select available topics to create a subscription -* **Skip validation** - (checkbox, optional): If checked - the component will not validate the incoming message to be sure that it comes from Shopify, use it for test purposes only! - -#### Input Metadata - -None. - -#### Output Metadata -Event from the subscription on the selected topic - -#### Limitations -* **Generate Stub Sample** works only for the most used objects -* This trigger doesn't support `Retrieve sample` functionality -* If you use ordinary flow (`real-time` not enabled) after flow starts you will need to run it once - just follow the webhook URL (to make the first execution) this action will create a subscription, error on this execution may be ignored +#### REST +- **URL** - `/products.json?fields=id,title`. +- **Method** - `POST`. +* **Request Body** - `{}`. ## Known limitations + * Look at [Shopify API rate limits](https://shopify.dev/api/usage/rate-limits), specially [GraphQL Admin API rate limits](https://shopify.dev/api/usage/rate-limits#graphql-admin-api-rate-limits) -* If the component reaches API rate limit it will retry the request after waiting until the queue is restored up to 10 times: for example - a query costs `500` points, currently available only `100` points, the restore rate `50` points/second, the component will wait `8` seconds until available points will be restored and try again to get data +* If the component reaches API rate limit it will retry the request after waiting until the queue is restored up to 10 times: for example - a query costs `500` points, currently available only `100` points, the restore rate `50` points/second, the component will wait `8` seconds until available points will be restored and try again to get data. - Be careful with several flows running at the same time, each of them can affect on total available points, if the component won't be able to get data after 10 retries, then the error `"Throttled"` will be thrown + Be careful with several flows running at the same time, each of them can affect on total available points, if the component won't be able to get data after 10 retries, then the error `"Throttled"` will be thrown. diff --git a/content/_components/whatsapp/index.md b/content/_components/whatsapp/index.md index 0d1cc1dd..16a3430d 100644 --- a/content/_components/whatsapp/index.md +++ b/content/_components/whatsapp/index.md @@ -71,10 +71,265 @@ None #### Input Metadata -Please refer to the [Input Schema file](./src/schemas/actions/sendMessage.in.json) for the full list of metadata fields. + +Please refer to the Input Schema file below for the full list of metadata fields. +
Input Schema file +```json +{ + "type": "object", + "properties": { + "to": { + "type": "string", + "title": "To", + "required": true, + "help": { + "description": "WhatsApp ID or phone number of the customer you want to send a message to. See Phone Number Formats link below", + "link": "https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers#phone-number-formats" + } + }, + "type": { + "type": "string", + "title": "Type", + "help": { + "description": "The type of message you want to send. If omitted, defaults to text" + }, + "required": false, + "enum": [ + "contacts", + "location", + "text", + "template" + ] + }, + "contacts": { + "type": "object", + "required": false, + "title": "Contacts", + "help": { + "description": "Required when type=contacts" + }, + "properties": { + "addresses": { + "type": "object", + "title": "Addresses", + "help": { + "description": "Full contact address(es) formatted as an addresses object" + }, + "required": false, + "properties": { + "street": { + "type": "string", + "title": "Street", + "help": { + "description": "Street number and name" + }, + "required": false + }, + "city": { + "type": "string", + "title": "City", + "help": { + "description": "City name" + }, + "required": false + }, + "state": { + "type": "string", + "title": "State", + "help": { + "description": "State abbreviation" + }, + "required": false + }, + "zip": { + "type": "string", + "title": "ZIP", + "help": { + "description": "ZIP code" + }, + "required": false + }, + "country": { + "type": "string", + "title": "Country", + "help": { + "description": "Full country name" + }, + "required": false + }, + "country_code": { + "type": "string", + "title": "Country code", + "help": { + "description": "Two-letter country abbreviation" + }, + "required": false + }, + "type": { + "type": "string", + "title": "Type", + "help": { + "description": "Standard values are HOME and WORK" + }, + "required": false + } + } + } + } + }, + "template": { + "type": "object", + "title": "Template", + "help": { + "description": "Required when type=template" + }, + "required": false, + "properties": { + "name": { + "type": "string", + "title": "Name", + "help": { + "description": "Name of the template" + }, + "required": false + }, + "language": { + "type": "object", + "title": "Language", + "help": { + "description": "Contains a language object. Specifies the language the template may be rendered in" + }, + "required": false, + "properties": { + "policy": { + "type": "string", + "title": "Policy", + "help": { + "description": "The language policy the message should follow. The only supported option is deterministic" + }, + "required": false + }, + "code": { + "type": "string", + "title": "Code", + "help": { + "description": "The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). For all codes, see https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages" + }, + "required": false + } + } + } + } + }, + "text": { + "type": "object", + "title": "Text", + "help": { + "description": "Required for text messages" + }, + "required": false, + "properties": { + "body": { + "type": "string", + "title": "Body", + "help": { + "description": "The text of the text message which can contain URLs which begin with http:// or https:// and formatting" + }, + "required": false + }, + "preview_url": { + "type": "boolean", + "title": "Preview URL", + "help": { + "description": "Set to true to have the WhatsApp Messenger and WhatsApp Business apps attempt to render a link preview of any URL in the body text string. URLs must begin with http:// or https://. If multiple URLs are in the body text string, only the first URL will be rendered" + }, + "required": false + } + } + }, + "location": { + "type": "object", + "title": "Location", + "help": { + "description": "Required when type=location" + }, + "required": false, + "properties": { + "longitude": { + "type": "string", + "title": "Longitude", + "help": { + "description": "Longitude of the location" + }, + "required": false + }, + "latitude": { + "type": "string", + "title": "Latitude", + "help": { + "description": "Latitude of the location" + }, + "required": false + }, + "name": { + "type": "string", + "title": "Name", + "help": { + "description": "Name of the location" + }, + "required": false + }, + "address": { + "type": "string", + "title": "Address", + "help": { + "description": "Address of the location" + }, + "required": false + } + } + }, + "preview_url": { + "type": "boolean", + "title": "Preview URL", + "help": { + "description": "Required if type=text" + }, + "required": false + }, + "status": { + "type": "string", + "title": "Status", + "help": { + "description": "A message's status. You can use this field to mark a message as read" + }, + "required": false + }, + "context": { + "type": "object", + "title": "Context", + "help": { + "description": "Required if replying to any message in the conversation" + }, + "required": false, + "properties": { + "message_id": { + "type": "string", + "title": "Message ID", + "help": { + "description": "ID of a previous message you are replying to" + }, + "required": false + } + } + } + } +} +``` +
+ Input message fields depend on the type of the message (one of 'contacts', 'location', 'text', 'template'). -E.g. in case type: "template" is specified, you must ensure the template is properly prepared and verified according to the Meta's requirements. -Please refer to the official guides on how to accomplish it. +E.g. in case type: "template" is specified, you must ensure the template is properly prepared and verified according to the Meta's requirements. Please refer to the official guides on how to accomplish it. An example of the input message with the template available for testing purposes: ```json diff --git a/content/_guides/rebound.md b/content/_guides/rebound.md index c0ad74fc..a3883f41 100644 --- a/content/_guides/rebound.md +++ b/content/_guides/rebound.md @@ -21,7 +21,7 @@ Connecting two separate systems can cause delays in any of single processes whic ## How the Rebound works? -When the message can not be processed by the component due to the insufficient information then it is sent back or rebounded. This means that the message is sent to a special queue where it waits for a minute and then re-queued for a repeated processing by the component. In case that the message is rebounded again then the waiting period is consequently increased with each iteration. This process can happen several times (currently it’s set to repeat 10 times), after which the message is rejected completely and an error is reported. +When the message can not be processed by the component due to insufficient information then it is sent back or rebounded. This means that the message is sent to a special queue where it waits and then re-queued for repeated processing by the component. In case the message is rebounded again then the waiting period is consequently increased with each iteration. This process can happen several times (depends on component), after which the message is rejected completely and an error is reported. ![Rebound-schematics](/assets/img/rebound/rebound-schematics.png)