Hi. I have a content byline item in Confluence that should dynamically update based on content properties of the page it is on. I fetch the properties with using @forge/api
.
In my test site (on a Free plan), the byline item is updated dynamically in both development and production. In my production site (on a Standard plan, just the production environment), it is not. The API call for the content property returns null
.
I run a similar call for the property in the inline modal dialog and it works there. Just not for the byline item.
Any insight into why this might be or where I could look to try to fix it?
Hi @AaronCollier,
Welcome to the Atlassian Developer Community. Can you specify the exact API you’re calling to fetch the properties? Are you using V1 or V2 of the API?
Thanks,
Ralph
Hi, @rwhitbeck. I’ve been using V1 with this route: /wiki/rest/api/content/${contentId}/property/${property}
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-properties/#api-wiki-rest-api-content-id-property-key-get Please note that the endpoint you’re using is listed as Deprecated so I would move to V2 before Feb 1, 2024. See changelog for more info: https://developer.atlassian.com/cloud/confluence/changelog/#CHANGE-1116
Can you post the full response that you are getting? I’m wondering if you’re getting permission problems as specified in the reference docs
Permissions required: ‘View’ permission for the space, and permission to view the content if it is a page.
I think you would get a 404 response back if so.
Some other thoughts. Have the properties been created in the new server yet?
I think the content properties endpoints weren’t deprecated when I started with the app, which is why I went with them. Switched to V2 and now seeing 404 responses with Could not find page with id
. In the manifest, I have read:page:confluence
under scopes as specified in the endpoint.
The full scope list:
permissions:
scopes:
- read:confluence-props
- write:confluence-props
- read:confluence-space.summary
- read:confluence-user
- read:content-details:confluence
- read:page:confluence
- read:permission:confluence
The properties have been created. I can retrieve them with a cURL request.
How are you creating the content properties?
With this endpoint https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-content-properties/#api-pages-page-id-properties-post
You’ll need the write:page:confluence
scope which i don’t see in your list above. (Perhaps that’s what write:confluence-props
was supposed to be?)
Ah, yes, the read:confluence-props
and write:confluence-props
were from V1. Will try updating the writing parts also to V2. But the properties still seem to be there.
From the docs for 404:
Returned if the calling user does not have permission to view the specified page, the page was not found, or the property was not found.
So there are 3 things here to look into more. Do you have permission, are you using the right content id/page id, is the property id correct?
At this point I don’t have the domain knowledge of your code to be more specific. Hopefully this helps to point you in the direction to find the problem.
2 Likes
Oh, wow. Of course it was permissions. A very foolish thing to be testing on (this page happened to be limited in permissions). Thanks so much for your patience and pointers!
1 Like