How can i get ipfs URL (image) by dedicated gateway

Now i try to make website by html and javascript .

how can i get IPFS url of image by dedicated gateway.

i used to use public infura like this

const IPFS_URL = “https://ipfs.io/ipfs/”;
const IPFS_API_URL = “ipfs.infura.io”;
const ipfs = window.IpfsApi(IPFS_API_URL, “5001”, { protocol: “https” }); // Connect to IPFS

but now it is not working so i made dedicated gateway but i don’t know how it use.

my dedicated gateway = https://benjaminkor2.infura-ipfs.io

Plz some one tell me how it use.

Hey @Mr_Tai

Thanks for bringing this to our attention. Lets modify only the ipfs_url. The ipfs_api_url stays the same. Your updated code should look like this:

const IPFS_URL = “https://benjaminkor2.infura-ipfs.io/ipfs/”;
const IPFS_API_URL = “ipfs.infura.io”;
const ipfs = window.IpfsApi(IPFS_API_URL, “5001”, { protocol: “https” }); // Connect to IPFS

Thank you i tryed it . but after it they show me that error

POST https://ipfs.infura.io:5001/api/v0/add?stream-channels=true 401 (Unauthorized)

Could you tell me what should i do?

Thank you i tryed it . but after it they show me that error

POST https://ipfs.infura.io:5001/api/v0/add?stream-channels=true 401 (Unauthorized)

Thank you for your Help.

I solved problem . :slight_smile:

2 Likes

Can you please mention , How ? I am also getting same error:
POST https://ipfs.infura.io:5001/api/v0/add?stream-channels=true 401 (Unauthorized)

@Shubham_Singh your requests must be authenticated now with your Infura IPFS dashboard’s API key and ID. Can you please provide a snippet of your code? We can take a look at it.

Kind regards,
Alex | Infura Support