Authentication
The JobWatch API uses Basic Authentication
, which requires the user to send a verified username
, password
and key
as headers, as part of the web service requests.
The key
is a unique identifier and is unique for each customer. This is provided by BigChange upon consultation
The below URL base is to be used for all web-services calls: https://webservice.bigchange.com/v01/services.ashx?parameters
Query String Parameters:
Name | Type | Description | Note |
---|---|---|---|
Action | String | What do you want to do? e.g. ContactSave, JobSave etc. |
Optional parameter:
Name | Type | Description | Note |
---|---|---|---|
Format | String | Format of the data returned. Available: JSON / XML / CSV | The default is JSON. |
CSV format will return a csv formatted file instead of the standard service response
Building the Request in Postman
- Open Postman and create a new request.
- Set the request type to
GET
. - Enter the URL:
https://webservice.bigchange.com/v01/services.ashx?action=ping
. - Click on the
Authorization
tab. - Select
Basic Auth
from the dropdown and enter yourusername
andpassword
. - Click on the
Headers
tab. - Add a new header with the key
key
and the value provided by BigChange. - Click on the
Send
button to make the request. - The response will be displayed in the
Response
section.
Alternatively, to create the Authorization header manually, you need to encode the username
and password
in base64 format, and then add it to the header with the key Authorization
.
Example: username: test@test.com
, password: password123
, formatted as: test@test.com:password123
will be encoded to: dGVzdEB0ZXN0LmNvbTpwYXNzd29yZDEyMw==
.
Example
- C#
- Python
using System;
using System.Net;
using System.Text;
using System.IO;
public class Program
{
public static void Main()
{
string _bigchangeUrl = "https://webservice.bigchange.com/v01/services.ashx";
string username = "Username";
string password = "Password";
string key = "CustomerKey";
string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + password));
string url = $"{_bigchangeUrl}?action=ping";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Headers["Authorization"] = "Basic " + credentials;
request.Headers["key"] = key;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader reader = new StreamReader(resStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer);
}
}
import requests
import base64
_bigchangeUrl = "https://webservice.bigchange.com/v01/services.ashx"
username = "Username"
password = "Password"
key = "CustomerKey"
jwheaders = {
"Authorization": f"Basic {base64.b64encode((username + ':' + password).encode()).decode()}",
"key": f"{key}",
}
url = f'{_bigchangeUrl}?action=ping'
response = requests.get(url, headers=jwheaders).json()
print(response)