Test endpoints before making them live for your users. We recommend that before you move to test an action, you should test all the respective endpoints so everything works properly.

Incoming Endpoints cannot be tested yet.

A little about Endpoints

Endpoints are the building blocks of integrations. They are the URLs, where the communication between the apps takes place. Learn more about endpoints and how they are created using our app. 

Let us say you have implemented your app, Basecamp through our web app. To execute one of the actions you have created an endpoint that fetches the list of Basecamp projects from the connected user account.

Testing Endpoints

The Basecamp API docs, say we will send a GET call, that returns an array of projects to us. After providing the required details for the endpoint, like Request URI, Request and Response Templates, Headers etc (learn more, here), you can test it. Before you save the endpoint at the bottom of the page you can view a Test Endpoint button as shown below. 

Click the Test Endpoint button. A Test Interface will appear in front of you as shown below. 

To send a test call to Basecamp for the endpoint, you need to provide the following details first:

Authentication Type: The authentication type the endpoint will use

Connected Account: The Basecamp (in this case) user account 

The JSON editor requires input that you need to send along the request URL i.e. as query parameters, request body parameters, headers etc. It supports both raw JSON and JSON editor. The Twig variables requestBody, requestBody.data, machine names of activity fields, query, header etc. all are available to this editor.

From the Basecamp documentation, it is evident that in order to fetch the project list we need to specify the account ID in the URL. We will provide the account ID through the editor as shown below. 

JSON input editor code

{
   "query":
   {
      "basecamp_account":NULL
   }
}

How do we get the account ID value?

In another tab, open the endpoints you have implemented using our web app. First, send a test call of the endpoint that returns the list of accounts. From the Basecamp API docs, we know we need to make a GET call with no parameters attached. So, we send the test call without writing anything in the JSON editor.

Note: If the request you are about to send does not need any headers, query parameters or request body parameters, leave the JSON Input Editor empty and make the call.

Success or Error Message

When you send the test call, at the bottom of the form the status of the call along with a message is displayed. It tells, whether the call sent was successful or not. It can display both success or error message.

You can view the details of the test call sent by clicking the View Details button at the right side. The request and response details will appear as shown below. 

Let us discuss what the individual fields are about, below. 

Request URI: Displays the URL that was called as a result of this endpoint

Parsed Request: Displays the structure of the request body

Request Headers: The headers that were attached along the request, depending on the app (Basecamp in this case) documentation

Response Headers: The headers that were received along the response

Raw Response: Actual response received by the external API

Endpoint Response: The shape of the response received after transforming it using Response Template

To get the account ID we will skip to the end of the form, to the Endpoint Response field. 

Copy the account ID.

Now, we go back to the Get Projects endpoint tab and in the JSON input editor, we assign the account ID to the basecamp_account variable as shown below.

{
   "query":
   {
      "basecamp_account":"4179809"
   }
}

As you enter the account ID you can send the test call. It is really important, that you use the same activity machine names in this editor as the actual activity fields machine names used in the endpoint, otherwise, it will return an error.  

Once the endpoint is tested properly and all the details are in place, you can move to test action.

Did this answer your question?