Make use of the API service request to obtain activity logs of specific staff user with its email or even the activity logs of admin user.
Required Parameters to Submit Request
- API Token- Token that you have generated using generate API token. Make sure you are using the most recent one.
- End Point- End point for the Add List API would appear http://my.mumara.com/api/getActivityLogs . It represents your instance of CampaignsPlus, along with the function name you are requesting through API
Required to Get Activity Logs
The email address of the staff/admin user is required to obtain/get its activity logs.
If you only provide the email address of the staff or admin user in the GET curl request, function will return the overall activity logs of that user in response. But you can also specify the type of logs you are looking to GET through the API. Following are the type of logs you can specify to obtain.
- Login-Logs of login activity only
- Logout-Logs of logout activity only
- Created-Logs related to the activities such as list creation, campaign creation etc.
- Updated-Whatever has been updated by the user falls in this type of activity logs, i.e. updated a contact information etc.
- Deleted-Activity performed by the user to delete certain resources, i.e. deleted a list etc.
You can also limit the number of logs you want to obtain in return of an API request. By default the limit is set as 10, but you can change it as well. If you put the limit as 20, it will return 20 recent activity logs of the user.
The sample request in the following area has these optional values selected as well.
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://my.mumara.host/api/getActivityLogsfirstname.lastname@example.org&type=login&limit=20"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec ($ch); print_r($output); curl_close ($ch); ?>
The Status value for the valid API request would be Success and it will return data according to the values provided in the API request, if you would only provide the email of the user to obtain its activity logs, it will return logs of the user's overall activity including logins, logouts, activity user has performed to create, update and delete resources. But if you specify the type of logs you are looking to obtain, response will only include the type of logs you have requested.
Status value will be error and response will have a text description of the error that occur.