Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Status of sg_event_id #2667

Closed
emiel opened this issue May 11, 2017 · 7 comments · Fixed by #3282
Closed

Status of sg_event_id #2667

emiel opened this issue May 11, 2017 · 7 comments · Fixed by #3282

Comments

@emiel
Copy link

emiel commented May 11, 2017

We are using the event webhook in our system and using sg_event_id to deduplicate events. We are curious what the format of this value is. From what I've found so far it is a base64 encoded UUID value and I'm able to decode it for the most part.

My issue is that it seems there are various forms in use. For click/open events they are all base64 UUIDs. A couple of examples are:

M2VjZjQzYjQtZWM4Ny00MWI5LWI2NTQtOGZhYjI3ODI1NGM3 | 3ecf43b4-ec87-41b9-b654-8fab278254c7

NjFjYTNlNWQtYzZlZi00ZmYyLTliMGUtNTM5MmYzOTVhYzI3 | 61ca3e5d-c6ef-4ff2-9b0e-5392f395ac27

NDVhMmM1N2QtNzI0Zi00NjhmLTlmZTEtOTk5NjY4ZTcyZWU1 | 45a2c57d-724f-468f-9fe1-999668e72ee5
$ echo "N2FkZTkxYjctYzAxNi00NzA2LTgxMDUtNTA5ZjEyZWQ5OWM3" | base64 -D
7ade91b7-c016-4706-8105-509f12ed99c7

Though for spamreport events the values are shorter. For example:

t0Odu9tQQLWvBPN4HXDbsA

I'm unable to decode this value and must assume it is a different format.

Could someone please shed some light on the difference and hopefully put up some documentation.

Thanks!

@apigirl
Copy link
Contributor

apigirl commented Jun 9, 2017

Hi @emiel, I added this to our documentation backlog to clarify the different value types. In the meantime, if you haven't figured out your issue already, you can reach out to our support team through https://support.sendgrid.com and they should be able to help you more quickly than we can.

@emiel
Copy link
Author

emiel commented Jul 3, 2017

Hello @ksigler7. Thanks for responding. Through observation and poking around we were able to decode the various forms of the sg_event_id. Though we understand the implementation the engineering trade-offs are a bit puzzling. :)

It was an interesting exercise and I've gone ahead and documented what we learned in a blog post.

https://emiel.github.io/decoding-the-sendgrid-event-id.html

Feel free to pass it along and give feedback.

@apigirl
Copy link
Contributor

apigirl commented Jul 3, 2017

@emiel wow, very cool. thanks for sharing this with me!

@akshat14714
Copy link
Contributor

akshat14714 commented Oct 30, 2017

@ksigler7 I would like to work on this issue. Should I add the type of sg_event_id in event.md ?

@apigirl
Copy link
Contributor

apigirl commented Oct 30, 2017

@akshat14714 thanks for your additions!

@duncanleung
Copy link
Contributor

@ksigler7 should this be closed?

I see that the PR was merged, but the ticket was reopened? Any additional information on this?

@apigirl
Copy link
Contributor

apigirl commented Oct 30, 2018

@duncanleung - I've dug into this and I have no idea why I reopened it.... :( I am going Hacktoberfest crazy

@apigirl apigirl closed this as completed Oct 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants