This topic contains 4 replies, has 0 voices, and was last updated by david.mendoza 7 years, 6 months ago.

  • Author
    Posts
  • #5712 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    Is this possible?

    I found articles and examples doing this with client scripts.

    I used article 51705 as an example.

    When trying to use the relative url of the RESTlet in the nlapiRequestURL function, the user event script throws this error: Code: SSS_INVALID_URL Details: The URL must be a fully qualified HTTP/HTTPS URL

    Thanks!
    This is a cached copy. Click here to see the original post.

  • #5713 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    The relative URL that you are using is does not have the domain since the string value of the result of nlapiResolveURL has no rest.netsuite.com or etc on it. Have you tried using the using the displayMode true to have the external URL then add the authentication header since the call on the server side would require Authentication header. Else if you don’t want to store the passwords, use Token-based authentication

  • #5714 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    Yes, I have used the absolute url of the RESTlet along with hard coded authentication values, which does sucessfully invoke the RESTlet from the User Event script.

    Nonetheless, based on all the articles in SuiteAnswers, I want to be able to do it similar to the client script example 51705 where authentication header is not required.

    Is this possible??

  • #5715 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    If you want to do the similar thing as noted on the article mentioned, it is not possible on the server side script. It works in the client side with this note “Because the client script is expected to have an active session, it uses a partial URL to call the RESTlet. That is, the URL does not have to include the RESTlet domain. You can find this partial URL in the URL field of the script deployment record for the RESTlet.” which can be found on SuiteAnswers 51013. But on server side, the session details are not added right away to the call that’s why you need to add an authentication header on your serverside script

  • #5716 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    I ended up invoking a suitelet.

    Thanks for the responses.

You must be logged in to reply to this topic.