This article is relevant if you are developing software on the NetSuite SuiteScript platform.
Background
While preparing for Built for NetSuite Certification for our Bitcoin Transaction Coordinator product offering, the requirements demand that certain credential information be encrypted and referenced with NetSuite’s nlapiRequestURLWithCredentials API call. The challenge with this API function is that it decrypts information and sends it on the internet via a secure SSL channel all in one call. It’s quite difficult to debug the decryption element because you can’t see any work it performs before it sends it out over the wire. See the article, “How to Use NetSuite’s nlapiRequestURLWithCredentials API’.
However, if you catch the HTTPS post information by being on the receving end of the post, you can diagnose your development work. As such, I created a generic utility that can be valuable for both generic RestLet and Suitelet work.
NetSuite HTTPS Inspection and Diagnostics
The software represents a combination of components to help you diagnose https posts both inbound and outbound from NetSuite.
- Custom HTTPS Inspection Log Record: Each http post creates an entry in a custom table to make it easy to diagnose inbound requests.
- Suitelet: A External Suitelet is configured to all you to allow inbound anonymous requests.
- Credential Record and Tests: To help learn how the nlapiRequestURLWithCredentials API call works, we supply a mechanism to outbound an https post to our utility to see all communications. This utility will be the subject of a different article.
Custom HTTPS Inspection Log Record
Click the image to get a sample view of the information caught on the HTTPS post. We break up the information as follows:
- Header Values
- Query Parameters
- Request Body
- Execution Context
External SuiteLet Endpoint
The SuiteLet is the endpoint that you will post to. Since you can setup it up as anonymous (available without login), you don’t need to perform any authorization to get it to listen to your post work. With some minor tweaks, the SuiteLet can be turned into a Restlet. Click the screenshot for the suggested deployment.
Install the Bundle
The utility is available as a shared bundle (ID# 42919). I am happy to share it with anyone who simply makes a request. Just use our contact us form on our corporate site.
One thought on “Diagnose and Inspect NetSuite HTTPS Posts”