Forum Discussion

Lutz's avatar
Lutz
Ace
12 years ago

Message-Attachments via Rest API

Hi,

 

I try to get Message-Attachments via Rest API.

What I do is to get URL from the response of : ../messages/id/#{message_id}/uploads/attachments

 

The URL I get looks like this :

https://THE-COMMUNITY/OUR_COMPANY/attachments/OUR_COMPANY/BOARD_NAME/BOARD_ID/1/"a file name even with spaces.pdf"

 

When I try do download this file , I get this error : "ERROR could not download file: 403 Forbidden"

 

I tried the same with uploads/images (to proof that I am doing everything in the right way) , and this works.

I can download images…even via HTTPS.

So what I´m doing wrong ? Any help is very welcome.

 

Regards

Lutz

  • Thanks for your answer.

     

    We found the solution.

    You must enable the option -Make all attachements public- in the admin interface.

     

    After that, you're able to download all attachements over the API

     

    Regards,

    Lutz

2 Replies

  • DougS's avatar
    DougS
    Khoros Oracle
    12 years ago
    Hi Lutz,

    Are you able to access the attachment when you go to the post via the web UI? If so, is there a difference you can see between that URL and the one returned by the API call? If so, then we might have a bug with the API call results. Otherwise, it might be a permissions issue (user viewing the attachment can't read the message the attachment is on).
  • Lutz's avatar
    Lutz
    Ace
    12 years ago

    Thanks for your answer.

     

    We found the solution.

    You must enable the option -Make all attachements public- in the admin interface.

     

    After that, you're able to download all attachements over the API

     

    Regards,

    Lutz