Using History API to get changed fields and author's name in

6 replies
Last updated: Feb 28, 2023
Using the History API, is there a way to get the exact fields that have been changed, so I can do a diff on them?I've used the
endpoint to get all the transactions, but I need to get access to the content to do a diff.
Feb 24, 2023, 5:32 PM
Also any way to extract the author's actual name instead of the id?
Feb 24, 2023, 5:46 PM
You would want to do something like this for every item on your list.

curl -H "Authorization: Bearer <token>" "<>"
The important thing to pass here is the
Feb 25, 2023, 1:02 PM
Thanks! That's exactly it. Not sure how I missed that in the docs. Any idea about extracting the author's actual name
Feb 26, 2023, 6:50 PM
I think I would make a fetch request with GROQ
[_type == "<your document type>" && _rev == "<rev id>"] { …, author-> }
That is basically getting the references of the author (just assuming)
Feb 27, 2023, 1:22 PM
Thanks, I found the endpoint I needed.

Feb 27, 2023, 5:36 PM
awesome. way to go
user F
Feb 28, 2023, 1:12 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?