Open
Conversation
- Added endpoint to access user activities
- Requires a JWT payload with {“user”: “username/email”} signed used
pre-shared key specified in .env, so only one “consumer” for now (could
easily be extended for arbitrary consumers though)
- JWT is added to the custom HTTP header “api-auth” (for some reason
the Authorisation header kept being stripped..), then sent to the
endpoint (/dashboard/api/get_user_activities).
- Can specify addition params (GET, could be changed though) to get
specific results by unit/platform (e.g.:
/dashboard/api/get_user_activities?platform=twitter,github)
Output looks like:
{
"user_activities": [
{
"date": "2017-02-17T08:55:53Z",
"platform": "Twitter",
"verb": "created",
"object":
"https://twitter.com/clatoolkitdev/status/832513891267547137"
},
{
"date": "2017-02-17T03:47:55Z",
"platform": "Twitter",
"verb": "created",
"object":
"https://twitter.com/clatoolkitdev/status/832436387924238338"
},
{
"date": "2017-03-18T03:07:20Z",
"platform": "Twitter",
"verb": "created",
"object":
"https://twitter.com/clatoolkitdev/status/842935421604528129"
},
{
"date": "2017-03-18T03:05:51Z",
"platform": "Twitter",
"verb": "created",
"object":
"https://twitter.com/clatoolkitdev/status/842935049884377088"
}
]
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pre-shared key specified in .env, so only one “consumer” for now (could
easily be extended for many consumers though)
the Authorisation header kept being stripped..), then sent to the
endpoint (/dashboard/api/get_user_activities).
specific results by unit/platform (e.g.:
/dashboard/api/get_user_activities?platform=twitter,github)
Output looks like:
{
"user_activities": [
{
"date": "2017-02-17T08:55:53Z",
"platform": "Twitter",
"verb": "created",
"object":"https://twitter.com/clatoolkitdev/status/832513891267547137"
},
{
"date": "2017-02-17T03:47:55Z",
"platform": "Twitter",
"verb": "created",
"object":"https://twitter.com/clatoolkitdev/status/832436387924238338"
},
{
"date": "2017-03-18T03:07:20Z",
"platform": "Twitter",
"verb": "created",
"object":"https://twitter.com/clatoolkitdev/status/842935421604528129"
},
{
"date": "2017-03-18T03:05:51Z",
"platform": "Twitter",
"verb": "created",
"object":"https://twitter.com/clatoolkitdev/status/842935049884377088"
}
]
}