Upload attachment to custom content getting 403 - User not permitted

Hi guys,

I’m trying to add attachments to custom content but I keep getting 403 user not permitted to create attachments for content: ContentId{id={contentId}}.

The content that I’m trying to attach to is custom content created by using Content API. I have “write” and “space_admin” scope in my descriptor and attachments are enabled in my Cloud site. And also the user account I’m using to fire this API has the update permission to the content I attach to.

I wonder what did my missed on this part, any help will be appreciated!

Here is the screenshot of the error:

The API endpoint I’m calling: https://{myCloudSite}/wiki/rest/api/content/35749913/child/attachment?_r=1638848311480

Hi folks!

I found the reason why I’m getting 403 as a return status. It’s because I didn’t include “attachment” as one of the “supportedChildTypes” of my custom content in the descriptor. Now with the “attachment” as the “supportedChildTypes”, the API is working.

1 Like

Can you post your newly update completed and working code? I have a similar issue happening.

Hey @RobF ,

You just have to include “attachment” as the “supportChildTypes” of your custom content in the App Descriptor like the example below:

'modules': {
        'customContent': [
               'key': "your custom content",
               'apiSupport': {
                        'supportedChildTypes': [
                            'attachment'
                        ]
               }
        ]
}