Troubleshooting Tips Making REST Calls

I’m writing a few troubleshooting tips when you are having a problem making REST calls. I intend to add more as I hear them.

1. POSTMAN is your friend

First and foremost, if you are having a problem making a REST call, please try to test, using a tool that you know should work to verify if your URL and data are correct. This will help narrow down if the issue is due to the data you are passing or your program processing the data.

As I wrote in the past, my favorite tool is POSTMAN. It’s a free tool. Some of my colleagues seem to like Paw.

2. GET vs. POST and Parameters in URL vs. Body

Another thing that people tends to overlook and mix sometimes is the method you need to use. Please make sure you use the right method. In particular GET vs. POST with Field API.

BIM 360 Field’s POST call expects passing parameter as Body. If you are passing parameters in an URL, try switching to Body. URL parameter has some limitations, such as length and character encoding (as well as security concerns for data being visible in the URL over the internet). The image below shows an example of calling Field API, POST /api/equipment with a long equipment data.

fieldequipmentpostman

If you click on “Generate Code”, POSTMAN generates a code snippet in a wide range of programming language, too.  It may help you if the issue is how to format a text data.

Mikako

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s