To generate a User Activity Report via the new API call in 4.x, take note of a few errors in the current documentation, here.
1) 'Start' should be 'Start-date'
2) The content-type should be application/x-www-form-urlencoded.
3) This is also a POST (properly documented, but worth noting)
4) The start-date & end-date values are strings and should be US format, MM/DD/YYYY.
5) Note that this generates a plain text response and will need to be parsed by the caller.
Example code
import requests
import json
import os
DOMINO_USER_API_KEY = os.environ['DOMINO_USER_API_KEY']
HOST = os.environ['DOMINO_API_HOST']
URL = HOST + '/admin/generateUserActivityReport'
values = {'start-date' : '10/01/2021','end-date' : '10/06/2021','lookback-days' : 30}
headers = {
'X-Domino-Api-Key': DOMINO_USER_API_KEY,
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.post(url=URL, data=values, headers=headers)
Comments
0 comments
Please sign in to leave a comment.