Help > Forum > Website Integration > Sample code for making an HTTP request

Sample code for making an HTTP request


If you are trying to integrate Single Sign On or Single Signup with your Website Toolbox forum, we highly recommend using our SSO Library. It contains one file with all of the library code you'll need and other files with example usage.

Note that PHP's cURL extension is required. That is installed on most servers by default.



This method requires the LWP::UserAgent module.


Forum API requests, such as for Single Sign On, require that you include your API Key in the request. Your API Key gives full permission to your forum via the API. It must be kept secure and private. Since JavaScript is a client-side language, your API Key would be fully visible to anyone who inspects the source code. Therefore, we do not recommend that API HTTP requests be made using JavaScript.

Due to restrictions imposed by web browsers on network connections across domain names, you would have to create a web proxy using one of the server-side programming languages to send a JavaScript HTTP request to our servers. Alternatively, you could use a CORS HTTP header to allow the cross-domain request.

We recommend using a framework like jQuery to make HTTP requests in JavaScript. If you would not like to use a framework, you can use the sample code below.




If you still need help, please contact us.