HTTP-request: Troubleshooting

Disclaimer 1: Over the years, the use of HTTP-actions is gradually being discouraged and replaced by API's. These API's can be used in action sequences.

Disclaimer 1: Over the years, the use of HTTP-actions is gradually being discouraged and replaced by API's. These API's can be used in action sequences. If you have a recent version of TOPdesk, you will not be able to use most of your HTTP requests. If you are affected by this change, read our landing page regarding this change: KI 14437 - Changes to HTTP Save Actions - FAQ. Disclaimer 2: Because of changes in the authentication mechanism of TOPdesk in Q4 of 2018, passwords in http-requests might no longer work. For more information, please refer to KI 10571 Answer: Please perform the checks below in the following order: Check 1: Refresh system settings in old TOPdesk versions If you use TOPdesk 5 or older, first refresh the System Settings (Settings > Refresh System Settings, in red circle). Close all open cards and open the card that triggers the event to test the http-request again. ※ Check 2: Trigger the HTTP-request manually via a context menu Check whether the HTTP-request works without linking it to an event. You can do this by adding the request to a context menu (see red circle in the image below), or copying and pasting it in a browser. ※ In TOPdesk 5, open the HTTP-request action, and tick a box under Special Events. Please note that copying and pasting in a browser does not work if \C \c or \U \u is used to escape special characters. TOPdesk must adjust the values between these operators; a browser cannot do this. This is why you should perform these HTTP-requests via a context menu or as a link in an email sent from TOPdesk. Option 3: Trigger the HTTP-request manually via a context menu logged in as an administrator Run the HTTP-request from a context menu with 'Show action' enabled on tab 'Additional', whilst logged in as an administrator. This runs the HTTP-request using the credentials of the currently logged in operator. ※ If this does work then the following may be the case: •The event linked to the HTTP-request is on elapsed time, and the HTTP-request did not include the parameters j_username and j_password. •On tab Response in the HTTP-request, 'Show response' was previously unticked, and the HTTP-request did not include the parameters j_username and j_password. •The user specified in the HTTP-request using the parameters j_username and j_password has insufficient permissions, or is included in a user filter. •'Show response' was already enabled on tab 'Response', whilst the event linked to the HTTP-request is on elapsed time. In this case, 'Show response' has to be disabled. •'Confirm before sending' is enabled, whilst the event linked to the HTTP-request is on elapsed time. In this case, 'Confirm before sending' has to be disabled. The parameters j_username and j_password ensure that TOPdesk logs in with this user's credentials to make the required change, and as such must have sufficient permissions to make the edit. Often this is a dummy user, for instance 'HTTPrequestuser'. You can test whether this user has been configured correctly by manually logging in with these credentials, and attempting to make the required edit. The setting 'Allow authentication parameters in the URL' under Functional Settings->Login Settings->Operator Section->Functionality. Check 4: Check servername, portnumber and SSL settings Check whether the servername and portnumber are correct, and whether SSL should be used. If SSL should be used, make sure that the correct portnumber for the secure connection is being used. With a SaaS environment, use 'This TOPdesk' Check 5: Remove validate=false It is advisable to check whether the HTTP-request fills in all mandatory fields. If this is not the case, you can add validate=false to the HTTP-request. Doing so ensures that no mandatory field check is performed before the HTTP-request is saved. Check 6: Check names and spelling which refer to database field names Check the name and spelling of all fields. HTTP requests require you to use the TOPdesk database field names. You can use the DataDict (TOPdesk menu > Help > DataDict) to find the field names in the TOPdesk interface and their equivalent in the TOPdesk database. Also check the exact values of the drop-down lists if these are filled in by the HTTP request. If there is a typo in the value of a drop-down list, TOPdesk will not find / fill the value. Check 7: Are their special characters? Check whether special characters are used. For example, TOPdesk's HTTP-requests start with a '?' and use '&' to link the various parts of an HTTP-request. If these characters are used in a field inserted into the HTTP-request, such as in the request or action field, the HTTP-request will not work. Such characters must be replaced with their hex variants. TOPdesk can do this automatically by surrounding the text with \U \u or \C \c. An example is shown in the image below: ※ They should only be used around the value that contains special characters that should be replaced (such as insertion fields). If they are used around the entire HTTP-request, the HTTP-request probably will not work. If you want to manually replace special characters with their hex equivalent (for instance when using fixed values), you can find a full reference list for URL encoding here: http://www.w3schools.com/tags/ref_urlencode.asp Check 8: Build up the HTTP-request step by step Split up the HTTP-request and test the simplest basic query first, such as opening a certain card. Start adding the other parts. Test the HTTP-request after adding each part. This method will help you determine which specific part is causing the problem. Check 9: Gather enough information in order to investigate the logfiles If you have run the checks above and the HTTP-request still does not work, please perform the following steps so TOPdesk Support can further investigate: •Run the HTTP-request. •Note the exact time, and the username. •Download the TOPdesk logfiles. •Upload the logfiles, and a copy of the HTTP-request, to this incident.