Cross reference id

I update a ghost site from an evernote notebook. In a ghost post I need a reference to an evernote note.
Currently I abuse the slug field and fill it with the uuid of the evernote note. I think a cross reference field is a must.

You could utilise the canonical field or one of the other meta fields in the post settings? Can I ask what your use case is?

Hi, Thanks for your reply. My use case is: from various notes in various notebooks in evernote I want - based on some criteria - create/update posts in Ghost. Every note in evernote has an uuid. If the note changes, the corrsponding post in Ghost will be automatically updated. To find the right post in Ghost I must have some link (reference id). Therefore I use the slug field to store the uuid. I think it is more and more common that people create/update post from other sources using the api. Therefore there should be something like a reference id. To use the canonical field seems to me not better than the slug field. Kind regards, Jacques Bopp

I think I understand what you’re doing. You could still use the canonical field in this case. Storing the evernote uuid in the canonical field would let you use the Ghost API to filter by the canonical property which would return the relevant post, including the reference id. That reference id can then be used in the Admin API to find and update the matching post.

This method would still give you the results you currently have, but would obscure the evernote reference in a lesser important field :blush:

Ok, thanks. Will change to ‘canonical_url’

1 Like

Hi, I tried it with the canonical_url. But this does not work. If I put a uuid (e.g. ‘3de2d6dd-b072-401c-bc44-0ee7b2bc0f1d’) in this field I can’t any longer edit this post in Ghost admin. I alway get the error “Update failed: Please enter a valid URL”. If I enter the uuid with some url prefix (e.g. Https:// I can’t any longer filter for a canonical_url ({‘message’: ‘Request not understood error, cannot list posts.’, ‘context’: ‘Error parsing filter’, ‘type’: ‘BadRequestError’, ‘details’: None, ‘property’: None, ‘help’: None, ‘code’: None, ‘id’: ‘07f07100-937b-11ea-963a-edfa4e505709’}.

Ah I see what’s happening. Sorry I forgot that the canonical field has URL validation. You could try with a different post meta field? Or even an internal tag, those can be grabbed from the Content API but won’t be shown in the published site