Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set relatedItems? #732

Closed
zopyx opened this issue May 24, 2019 · 2 comments · Fixed by #758

Comments

@zopyx
Copy link
Member

commented May 24, 2019

The documentation for setting a relation https://plonerestapi.readthedocs.io/en/latest/serialization.html#relations is a bit short.

On the source side we have a list of UIDs (from AT content) and need to set them as relatedItems on the related resource. Source and target system use the same UIDs.

What is the correct data format for settings UIDs? Any example?

@buchi

This comment has been minimized.

Copy link
Member

commented May 30, 2019

You can set relatedItems either by UID, path, URL or intid.

Examples:

{
  "relatedItems": [
    "158e5361282647e39bf0698fe238814b",
    "5597250bda4b41eab6ed37cd25fb0979"
  ]
}
{
  "relatedItems": ["/page1", "/page2"]
}
{
  "relatedItems": [
    "http://localhost:8080/Plone/page1",
    "http://localhost:8080/Plone/page2"
  ]
}
{
  "relatedItems": [347127075, 347127076]
}
@zopyx

This comment has been minimized.

Copy link
Member Author

commented May 31, 2019

Thanks...this example should be put into the documentation. It's more understandable than having text only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.