This topic contains 2 replies, has 0 voices, and was last updated by Dale Johnson 7 years, 6 months ago.

  • Author
    Posts
  • #6577 Score: 0

    Dale Johnson
    • Contributions: 0
    • Level 1

    All 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.

  • #6578 Score: 0

    michoel
    • Contributions: 0
    • Level 1

    Thanks 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..

  • #6579 Score: 0

    Dale Johnson
    • Contributions: 0
    • Level 1

    Michoel: 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!

You must be logged in to reply to this topic.