This topic contains 2 replies, has 0 voices, and was last updated by Dale Johnson 8 years ago.
-
AuthorPosts
-
November 10, 2016 at 12:24 pm #6577
Dale JohnsonAll FYI:
I am experimenting with connecting PERL to NetSuite using RESTLets: the early results are extremely encouraging. Here is all that was required on the PERL side:
—————————————-
#!/usr/local/bin/perl
use 5.14.0;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $url = ‘https://rest.na2.netsuite.com/app/site/hosting/restlet.nl?’.
‘script=97&deploy=1’;
my $auth = ‘NLAuth nlauth_account=TSTDRVxxxx, ‘.
‘nlauth_email=ss2.xxxxx@netsuite.com, ‘.
‘nlauth_signature=training1, ‘.
‘nlauth_role=3’;
say $ua->get($url => {Authorization => $auth})->res->body;
————————————–
and here is the RESTLet:
————————————–
/**
* @NApiVersion 2.x
* @NScriptType Restlet
* @NModuleScope SameAccount
*/
define([],
function() {
function doGet(requestParams) {
return ‘Hello Dale’;
}
return {
‘get’: doGet,
};
});
—————————————
I would be intereted in sharing code and help with anyone else interested in this approach. (It looks to me like a whole lot of general functionality could be coded in a rather small RESTLet this way).
–Dale Johnson, Merit Network, Inc.
This is a cached copy. Click here to see the original post. -
November 10, 2016 at 6:04 pm #6578
michoelThanks for sharing, looks great.. though to be pedantic it’s SuiteScript 2.0 not SuiteTalk..
Have you tried using TBA rather than hardcoding the password in the script? I managed to get that working in PHP (http://stackoverflow.com/a/32983952/3230114), but when I tried translating the logic to Perl I just couldn’t get it to work. I ended up giving up and just writing my script in PHP..
-
November 14, 2016 at 7:14 am #6579
Dale JohnsonMichoel: right you are, thanks: SuiteScript 2.0 not SuiteTalk. No, I haven’t tried TBA; I’ve got a bit more basic functionality to get working first. Thanks!
-
AuthorPosts
You must be logged in to reply to this topic.