Knowledgebase

Get Activity Logs

Method: GET
Endpoint: /api/getActivityLogs

Parameter

Parameter Type Required

Description 

user_id int No Get activity logs of a particular user
limit_start int (default: 0) No Starting row of result. Default: 0
limit_count int (default: 100) No Number of records to get. Default: 25

Response Parameters

Parameter Type Description
status JSON Success or Error
result JSON Result of the operation
response JSON Output of the operation


Example Request (CURL)

<?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/getActivityLogs';

//parameters
$data = array (
    'user_id'	    => '2',
    'limit_start'	=> '0',
    'limit_count'	=> '2',

);

$params = '';
foreach($data as $key=>$value)
$params .= $key.'='.$value.'&';
$params = trim($params, '&');

// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.'?'.$params);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Executing cURL
$output = curl_exec ($ch);

// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );

// Closing cURL
curl_close ($ch);

?>


Example Response (JSON)

 {
    "status": "success",
    "result": [
        {
            "id": 12,
            "user_id": 2,
            "activity": "Login",
            "type": "login",
            "description": "Mumara has been Login",
            "created_at": "2019-05-03 10:34:44",
            "updated_at": "2019-05-03 10:34:44"
        },
        {
            "id": 13,
            "user_id": 2,
            "activity": "Created",
            "type": "bounce",
            "description": "Bounce Handling Created Successfully([email protected])",
            "created_at": "2019-05-06 08:33:46",
            "updated_at": "2019-05-06 08:33:46"
        }
    ]
 }
Status value of the success response will be "Success"


Example Error Response (JSON)

 {
    "status": "error",
    "result": "Error: Activity Log doesn't exist."
 }


Possible Errors

  • Invalid user id
  • Access Denied
GET
/api/getActivityLogs
Try it out