Method: PUT
Endpoint: /api/updateSpinTag/{id}
Parameter | Type | Required |
Description |
id | integer | Yes | id of spintag which you want to update |
place_holder | string | No | A unique title for spintag |
word_list | coma seprated word list i.e(john,alex,david,james) | No | List of values for a spintag |
response | 0, 1 (default: 0) | No | Get full response of the operation |
Parameter | Type | Description |
status | JSON | Success or Error |
result | JSON | Result of the operation |
response | JSON | Output of the operation |
<?php
// Authentication
$api_token = 'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain = 'http://www.anydomain.com'; // Your Mumara Domain Name
// API Endpoint
$endpoint = '/api/updateSpinTag/';
//spintag Id
$spintag_id = 20;
$params = [
'place_holder' => 'F name',
'word_list' => 'Adi,Eddie,Abraheem',
'response' => '1'
];
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$spintag_id );
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Executing cURL
$output = curl_exec ($ch);
// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );
// Closing cURL
curl_close ($ch);
?>
{
"status": "success",
"result": "Success: Spintag has been successfully updated.",
"response": {
"id": 15,
"user_id": 2,
"place_holder": "F name",
"tag": "f_name",
"word_list": "Adi\r\nEddie\r\nAbraheem",
"created_at": "2020-10-13 10:43:22",
"updated_at": "2020-10-13 10:59:35"
}
}
Status value of the success response will be "success"
{
"status": "error",
"result": "Error: At least one parameter value is required to update record."
}