Skip to content

Conversation

@zwaters
Copy link
Collaborator

@zwaters zwaters commented Jul 11, 2017

  • Added endpoint to access user activities
  • Requires a JWT payload with {“user”: “username/email”} signed using
    pre-shared key specified in .env, so only one “consumer” for now (could
    easily be extended for many 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 additional params so narrow search scope (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"
}
]
}

@zwaters zwaters requested a review from kirstykitto July 11, 2017 01:49
- 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"
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants