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.

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'
                        ]
               }
        ]
}

hey guys,

it will be a great thing if you can help me, m struggling uploading attachment to the custom-content , i get the error 400 , bad request, at least one attachment included. i did all the solutions in my head, so maybe it’s a formdata error or an api schema or idk