I’m getting an INVALID_DOMAIN exception on my <htt...
# ask-stanley-ai
t
I’m getting an INVALID_DOMAIN exception on my https.post request even though the URL looks perfect and resolves correctly. No special characters are used in the domain or the whole URL. Are there any length limits to the whole URL or any way to whitelist?
c
AI generated answer (using internal Slack threads):
Based on the conversations, the
INVALID_DOMAIN
error you're encountering with your
<http://https.post|https.post>
request in SuiteScript could be due to a couple of reasons: 1. API Secrets Restrictions: In NetSuite, each API secret can be restricted for use for only certain outgoing domains. If you're trying to use a secret that is not authorized for that domain, you might get the "invalid domain" error message. The domain must match exactly. For example,
<http://atradius.com|atradius.com>
does not match
<http://api-uat.atradius.com|api-uat.atradius.com>
. You can check this in NetSuite under Setup > Company > API Secrets. 2. Incorrect Encoding: There was a case where the encoding script from SuiteAnswer was not producing the correct base 64. The user resolved the issue by using the following code snippet:
Copy code
javascript
// Create BASE-64 encoded name:password pair
let base64 = encode.convert({
    string: `${nameToken}:${passwordToken}`,
    inputEncoding: encode.Encoding.UTF_8,
    outputEncoding: encode.Encoding.BASE_64
});
3. URL Format: Ensure that the URL is a fully qualified HTTP URL. If you're using a variable for the URL, you might want to log it just before the https send to ensure it contains what you expect. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819708586
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800120652
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.798053861
Please provide your feedback on this answer.