How to determine if an activity webhook payload is the final version?
AllUrbanBug3 months ago
Hi, I'm building a fitness app that receives activity data via webhooks.
I have two questions regarding activity data updates:
- Is there a way to know if an activity payload is the final version?
When I receive an activity webhook with a specific summary_id, is there any flag or indicator that tells me "this is the complete/final version and no further updates will follow"?
I need to trigger a downstream action (creating a user-facing post) only when the activity data is finalized, so knowing when the data is "complete" is important for my use case.
- How long can updated versions of the same activity keep arriving?
I understand that the same summary_id can be sent multiple times and should be overwritten each time. But what is the realistic time window for these updates? Could an update arrive 40 minutes or even hours after the initial webhook? Is there a maximum delay we should account for?
Any insights from the team or community would be greatly appreciated. Thanks!
Vanessaadmin2 weeks ago
There's no explicit "final" flag, but here's how to handle it:
1. Each activity is identified by summary_id in the metadata. When you receive the same summary_id again, the new payload is always a superset of the previous one -- so always overwrite.
2. The upload_type field in metadata tells you what kind of update it is:
- 1 = Automatic (initial upload)
- 2 = Manual
- 3 = Update (explicitly an update to a previous payload)
- 4 = Delete
- 5 = Pending
Hope this helps!