Forum Discussion
.Net GetActivityEventsAsync fails with Bad Request
- 5 years ago
The problem was solved by enclosing the dates in single quotes:
var logs = await client.Admin.GetActivityEventsAsync(startDateTime:string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopStart), endDateTime:
string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopEnd));
If you use ContinuationToken make sure to both enclose it in sinqle quotes and UrlDecode it before passing it as a parameter.
The problem was solved by enclosing the dates in single quotes:
var logs = await client.Admin.GetActivityEventsAsync(startDateTime:string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopStart), endDateTime:
string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopEnd));
If you use ContinuationToken make sure to both enclose it in sinqle quotes and UrlDecode it before passing it as a parameter.