Recover properties in a prolog data structure

I’m using: SWI-Prolog version 8

I want the code to:
Recover the value of a properties in this data structure : context(headers(acces_id('1598745172065'),version_id('1598745172065'))) i want to get to the acces_id value .
But what I’m getting is:

"code": 500,
"message": "Type error: `dict' expected, found (a compound)

My code looks like this:


You need to understand unification.

See: Learn Prolog Now! - Unification.

I would suggest starting from the beginning of Learn Prolog Now!