Images not showing after successful upload

I have successfully upload a file on sendbird server, but when i am trying to show that in chatlist the image is not visible and throwing “Not Authorized” error when trying the same image url in web browser.

Hello, can you please try using Javascript SDK and list this file message. You should see a “url” parameter with the authorization key for accessing this file.

Hey walter,

I am using Javascript SDK only for this, but in messages i am getting “plainUrl”: “https://file-ap-8.sendbird.com/a47bc97f98554670b317bebf6c2d78d5.jpg”, this key without auth key. not receiving any url key in the response.

Thanks

Can you please confirm you are not getting this url parameter in your Chrome console?

I am receiving only plainUrl not this “url” key in the messages data

What is your Javascript SDK version please?

my sendbird package version is 3.0.141

I’ll send you a simple test if you can try it please.
Just replace with your application ID and one of your valid users…

ok, please share it, because its a important feature of our application.

It’s very simple. Replace inside index.js, save and then drag the index.html to any Chrome (Firefox, etc) window.

var APP_ID = 'YOUR-APPLICATION-ID';
var USER_ID = 'ANY-USER-ID';
var ACCESS_TOKEN = null;
var CHANNEL_URL = 'ANY-CHANNEL-URL';

User and channel should have FILE type messages.
You should see a list of FILE messages in your console.

If URL is not showing, please let me know in the ticket you created, I need to escalate this.

Hey walter,

its working from this page, but not working in my application.

What platform are you using?

i am building this application in react native

This is a project created using:

react-native init [ProjectNameHere]

Without any extra package. So, it’s something very basic.

Inside App.js you should replace the following with your information:

const sb = new SendBird({ appId: 'YOUR APP ID HERE'});
const userId = 'YOUR USER ID HERE';
const accessToken = null;
const groupChannelUrl = 'YOUR CHANNEL HERE';

Run: npm i to install packages (including Sendbird)
And then: npx react-native run-ios or android (depending your target)

Please see attached screenshot showing how it works for me.

Repository:

App.js

Hi @walter.rodriguez
I’m sending a file message and it is also uploaded on sendbird and url is coming inside the file in response but in chatlist is not being display…
i’m using “Platform API” for sending file message (“POST https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/messages”) with required properties.

I found the issue … in my url there is no auth key at the end of the URL…
could you help me out about this

Hi @Daud

You are receiving the file information (after uploading) from Platform API, correct?

And this information from Platform API about the message does not have the authorization part so the image can’t be shown. Please confirm this part. Thanks.

I’ve the same issue

Catching up on that and respond.

But I’ve also received the access_token after I created user
then why sendbird system not sending me auth key with image url?