0

I believe I'm following the documentation correctly for the Getstream REST API but for the life of me can't get an activity of mine to update it's contents.

I'm using the following endpoint: https://us-east-api.stream-io-api.com/api/v1.0/activities/?api_key={{API_KEY}}

I'm using the following headers: Stream-Auth-Type: jwt Authorization: <properly generated JWT feed token> Content-Type: application/json Cache-Control: no-cache

I'm using the following payload for the authorization: { "resource": "activities", "action": "write", "feed_id": "*" }

The body of my JSON request: {"activities": [{ "actor": "Aaron Clay", "actorname": "Aaron Clay", "avatarSubTitle": "", "avatarUrl": "<URL>", "foreign_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "htmlmarkup": "<p>Test post from REST API updated</p>", "object": "Doppler Notification", "time": "2018-05-10T13:44:02.463743", "verb": "post" }]}

The activity I'm attempting to update: { "actor": "Aaron C", "actorname": "Aaron C", "avatarSubTitle": "", "avatarUrl": "<URL>", "foreign_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "htmlmarkup": "<p>Test post from REST API</p>", "id": "33053fea-5458-11e8-91af-121fdba36dae", "object": "Doppler Notification", "origin": null, "target": "", "time": "2018-05-10T13:44:02.463743", "verb": "post" }

All I get back from the call is a 201 Created status and the body is: { "duration": "5.77ms" }

If I then query the feed group that this activity was part of I don't see the change in the htmlmarkup that I was intending.

Any ideas of what I might be missing?

AJC
  • 21
  • 3
  • you can only update activities that you inserted with `time` field provided. – Tommaso Barbugli May 11 '18 at 13:08
  • Thank you for the response. I got it to work. The documentation was a little confusing when seeing that `time` was optional yet had a default value that was the same as what I would normally set. So naturally there's no way to differentiate what activities were created with setting time vs. those that have time set by getstream when seeing the results from the feed `GET` call. – AJC May 11 '18 at 18:17

0 Answers0