File message unauthorized

when I send a file message and after the message sent to send bird the return message object that sends bird returns the object has a property called plain URL when I open the URL in the browser its give me an unauthorized error any solution

1 Like

I have the same problem. When i develop sendbird chat on web. I retrieve property url in _sender but react native not

@Taimoor_Tariq

Hi there. Just to mention that by default all new Sendbird apps provide file encryption. This means that your file url also requires authentication to be accessible. There are details explaining how it works here.
Please let me know if this doesn’t solve your problem. :slight_smile:

@Jason where I got this auth in the message object ? or when user connect to send bird server and got the response object from send bird ?

@Taimoor_Tariq

When the user connects to Sendbird to fetch the FILE message the returned FILE message object will include the image url with the auth token included as a param. The file url looks something like this:

https://file-us-1.sendbird.com/f9196f01d7134767a6575355329c54dc.jpg?auth=3UrR9uQUcPIwHPwZBDY4nhffwpQI774VHpcuJh-rE_jXtxJ5U5-Hwr3ByXiS-jznigPlGYmbIGqJMhDmhOCylQ

Thank a lot for your replying. This is my console.log for response. My react native app never get properties like before.

@Chin_Chin @Taimoor_Tariq

Something is not right. I’m working with our engineers to find out the problem. I will keep you posted.

1 Like

Ok @Jason i m waiting for your reply , thanks

During the call can we use the share screen feature as well?

@Taimoor_Tariq @Chin_Chin

I found out more about the plainUrl. If your Sendbird application doesn’t have file encryption turned on your will see the plainUrl field. Please let me know you app_id via direct messages if you would like file encryption turn on.

Furthermore, it turns out the incoming message model is not the same as the model processed by the SDK. It means you can still get message.url within the scope of the SDK. It happens that the raw message model in the console shows plainUrl.

1 Like

@Taimoor_Tariq

Currently the Sendbird Calls SDK doesn’t include screen sharing. It’s on the Roadmap but isn’t available yet.

@Jason I already have the plain URL but when I try to open that URL on the browser, it returns the Not authorized error.
The actual object is in the attachment below

i solved this problem but not clean create Channel with platform api, and call messages will be show url in thumnails. I dont know why but it works without property url

but when you send other types of data like pdf, docs, etc then you have an empty thumbnail array and how would you handle this scenario?

1 Like

Any Update @Jason about the File message unauthorized issue

@Taimoor_Tariq with an empty thumbnails array I would look at the file.type and render a small image that represents that file type.

Regarding the issue with plainUrl. Please can you direct message me your Sendbird application_id. You can find it in your Sendbird Dashboard under Overview. I will check if you have file encryption turned on.

@Jason did you got the application_id I send you in direct message