You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/getting-started/providers/netsuite.mdx
+61-53Lines changed: 61 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,8 @@ import { Code } from "@/components/Code"
5
5
6
6
# NetSuite
7
7
8
+
<Callouttype="warning">To be released in `[email protected]`</Callout>
9
+
8
10
## Resources
9
11
10
12
-[NetSuite - Creating an Integration Record (OAuth 2.0)](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157771733782.html#Related-Topics)
@@ -16,11 +18,6 @@ import { Code } from "@/components/Code"
16
18
17
19
### Callback URL
18
20
19
-
<Callout>
20
-
NetSuite does not support http. When testing locally, you can use a service
21
-
like [ngrok](https://ngrok.com) to get a local https URL.
> NetSuite does not support `http://` callback URLs. When testing locally, you can use a service like [ngrok](https://ngrok.com) to get a local `https` URL.
46
+
47
+
### Environment Variables
48
+
49
+
```
50
+
AUTH_NETSUITE_ID
51
+
AUTH_NETSUITE_SECRET
52
+
AUTH_NETSUITE_ACCOUNT_ID
53
+
```
54
+
55
+
### Configuration
56
+
57
+
Before setting up the provider, you will need to ensure the following is setup.
58
+
59
+
-[Create an Integration Record](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157771733782.html#procedure_157838925981)
60
+
- Uncheck the TBA Auth Flow checkbox.
61
+
- Check OAuth 2.0 Auth Flow checkbox.
62
+
- Copy and paste the `Callback URL` below into the `Redirect URI` field.
63
+
- Then select the scope(s) you want to use.
64
+
-**REST Web Services** (`rest_webservices`) - Access to REST Web Services.
65
+
-**RESTlets**(`restlets`) - Access to RESTLets.
66
+
-**SuiteAnalytics Connect** (`suiteanalytics_connect`) - Access to SuiteAnalytics Connect.
67
+
- Add any policies you want to use.
68
+
- Application Logo (_Optional_) (Shown to users when they are asked to grant access to your application). - Consent Screen
69
+
- Application Terms of Use (_Optional_) - A PDF file that contains the terms of use for your application. - Consent Screen
70
+
- Application Privacy Policy (_Optional_) - A PDF file that contains the privacy policy for your application. - Consent Screen
71
+
- OAuth 2.0 Consent Policy Preference - This setting determines whether the user is asked to grant access to your application **every time** they sign in or only the **first time** they sign in or **never**.
72
+
-**Save** the Integration record.
73
+
- The Integration record will be used to generate the `clientId` and `clientSecret` for the provider. **Save the generated values for later**
74
+
75
+
### Userinfo RESTLet Handler
42
76
77
+
To use this provider, you'll need to create a userinfo RESTlet in your NetSuite instance.
43
78
Our `userinfo` URL needs to be a suitelet or RESTLet URL that gives us the
44
79
information about the user. The best bet is to use the `N/runtime` module to
45
80
get the basics first. - Here is an example of a RESTlet below. Be sure to
46
81
deploy and enable access to "All Roles".
47
82
48
-
### Example RESTLet Callback Handler
49
-
50
83
Be sure to deploy and use the **external** RESTLet url of any usage of the URIs.
51
84
52
85
```js
@@ -55,16 +88,15 @@ Be sure to deploy and use the **external** RESTLet url of any usage of the URIs.
55
88
* @NScriptType Restlet
56
89
*/
57
90
define(["N/runtime"],
58
-
@param{runtime} runtimee
59
91
(runtime) => {
60
-
/**
61
-
* Defines the function that is executed when a GET request is sent to a RESTlet.
62
-
* @param{Object}requestParams - Parameters from HTTP request URL; parameters passed as an Object (for all supported
63
-
* content types)
64
-
* @returns{string | Object} HTTP response body; returns a string when request Content-Type is 'text/plain'; returns an
65
-
* Object when request Content-Type is 'application/json' or 'application/xml'
66
-
* @since 2015.2
67
-
*\/
92
+
/**
93
+
* Defines the function that is executed when a GET request is sent to a RESTlet.
94
+
* @param{Object}requestParams - Parameters from HTTP request URL; parameters passed as an Object (for all supported
95
+
* content types)
96
+
* @returns{string | Object} HTTP response body; returns a string when request Content-Type is 'text/plain'; returns an
97
+
* Object when request Content-Type is 'application/json' or 'application/xml'
98
+
* @since 2015.2
99
+
*/
68
100
constget= (requestParams) => {
69
101
let userObject =runtime.getCurrentUser();
70
102
@@ -100,46 +132,21 @@ define(["N/runtime"],
100
132
101
133
Above is an example of returning the basic runtime information. Be sure to create a new script record and deployment record. When you save the deployment record, you will get the URLs for your RESTlet, which we will use as the `userinfo` URL.
102
134
103
-
### Environment Variables
104
-
105
-
```
106
-
AUTH_NETSUITE_ID
107
-
AUTH_NETSUITE_SECRET
108
-
```
109
-
110
-
### Configuration
111
-
112
-
Before setting up the provider, you will need to ensure the following is setup.
113
-
114
-
- [Create an Integration Record](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157771733782.html#procedure_157838925981)
115
-
- Uncheck the TBA Auth Flow checkbox.
116
-
- Check OAuth 2.0 Auth Flow checkbox.
117
-
- Copy and paste the `Callback URL` below into the `Redirect URI` field.
118
-
- Then select the scope(s) you want to use.
119
-
- **REST Web Services** (`rest_webservices`) - Access to REST Web Services.
120
-
- **RESTlets**(`restlets`) - Access to RESTLets.
121
-
- **SuiteAnalytics Connect** (`suiteanalytics_connect`) - Access to SuiteAnalytics Connect.
122
-
- Add any policies you want to use.
123
-
- Application Logo (_Optional_) (Shown to users when they are asked to grant access to your application). - Consent Screen
124
-
- Application Terms of Use (_Optional_) - A PDF file that contains the terms of use for your application. - Consent Screen
125
-
- Application Privacy Policy (_Optional_) - A PDF file that contains the privacy policy for your application. - Consent Screen
126
-
- OAuth 2.0 Consent Policy Preference - This setting determines whether the user is asked to grant access to your application **every time** they sign in or only the **first time** they sign in or **never**.
127
-
- **Save** the Integration record.
128
-
- The Integration record will be used to generate the `clientId` and `clientSecret` for the provider. **Save the generated values for later**
0 commit comments