This API service allows clients to interact with a database using various query operations such as Select, Create, and Update. The service utilizes cURL for making HTTP requests and PHP's PDO for database interactions.
https://database.thinkinsurance.co.uk/Request.phpThe API uses Bearer Token authentication. Include the token in the Authorization header of each request.
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Select",
"RequestPacket": {
"Connection_ID": 1,
"Query_ID": 1,
"BindParams": {
":Template_ID": 1
}
}
}' \
https://database.thinkinsurance.co.uk/Request.php
The requesting page script processes incoming requests and interacts with the database service. Here's how it works:
For each of the following operations, provide the Request parameter as follows:
'Select' to retrieve data from the database.'Create' to insert new data into the database.'Update' to modify existing data in the database.
{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Select",
"RequestPacket": {
"Connection_ID": 1,
"Query_ID": 1,
"BindParams": {
":Template_ID": 1
}
}
}
{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Create",
"RequestPacket": {
"Connection_ID": 2,
"Query_ID": 2,
"BindParams": {
":Template_Name": "New Template",
":Template_Output": "Template Output"
}
}
}
{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Update",
"RequestPacket": {
"Connection_ID": 3,
"Query_ID": 3,
"BindParams": {
":Template_ID": 1,
":Template_Name": "Updated Template",
":Template_Output": "Updated Output"
}
}
}
When using the API service, adhere to the following guidelines for proper usage:
{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Select",
"RequestPacket": {
"Connection_ID": 1,
"Query_ID": 1,
"BindParams": {
":Template_ID": 1
}
}
}
{
"Credentials": {
"Username": "your_username",
"Password": "your_password"
},
"Request": "Update",
"RequestPacket": {
"Connection_ID": 2,
"Query_ID": 2,
"BindParams": {
":Template_ID": 1,
":Template_Name": "New Template"
}
}
}