<@UGRLQ0L64> this option on the suitelet deploymen...
# suitescript
n
@Seth_at_TBMBM this option on the suitelet deployment. You'll then have an "external url" you can use.
s
Thanks. That will work
z
@NElliott Have you had any 405 - Method not allowed issues when doing that?
b
@Zack that generally means you arent setting the User-Agent header to a value
z
@battk Yep, unfortunately the web hooks that I have to use don’t allow any header selection.
b
I do believe you are doomed then. You can try asking NetSuite support if there is an alternate solution
m
Suitelets available externally need a browser user agent. I have the same issue, the way around it was to use a serverless cloud function (e.g. Google Cloud Function) to proxy the request.
Copy code
const request = require('request');

exports.webhook = (req, res) => {
  console.log('request', req.body);
  <http://request.post|request.post>(
      {
        url: process.env.NETSUITE_SUITELET_URL,
        body: req.body,
        json: true,
        headers: {
          'User-Agent': 'Mozilla/5',
          Authorization: req.headers['authorization'],
        },
      },
      function(error, response, body) {
        console.log('response', body);
        res.send(body);
      }
  );
};