Retrieving metadata at opensea with ERC-1155 problem

Hello, i have basic erc-1155 contract deployed like this:

pragma solidity 0.8.0;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract coin is ERC1155 {
 
    constructor() ERC1155("https://www.xxxxx.es/JSONS/") {
        _mint(msg.sender, 1 /* Id Zanahoria */, 10 /* Cantidad */, "");
        _mint(msg.sender, 2 /* Id Papa      */, 20 /* Cantidad */, "");
    }
}

Then i have modified the function uri (in erc1155.sol) like this to concatenate _url, with id

 function uri(uint256 id) public view virtual override returns (string memory) {
  
      string memory  st="";
      string memory st3= string(abi.encodePacked(st, Strings.toString(id)));
      st=string(abi.encodePacked(_uri, st3));
   
         return st;
    }

When deployed, function uri() returns this


https://www.xxxxx.es/JSONS/1

i also tried

https://www.xxxxx.es/JSONS/1.json

or

https://www.xxxxx.es/JSONS/000....00001.json

I also tried like the example

constructor() public ERC1155("https://game.example/api/item/{id}.json")

In my private server theres that path with accordingly named json at each try.

And nothing is working, i mean opensea can not read the metadata json file.

Thanks

What the Am I doing wrong please

Hi, welcome! :wave:

Yes, I also think you should set the parameter like above.

And there is a tutorial for creating ERC1155 token, you can have a look:

Mmmm, trying that validator

https://rinkeby-api.opensea.io/asset/0xc138454c71B6B976775fe8E3bEd859d17afC92B7/2/validate/

replacing contract address and token id, i found that server is returning Error 403: Forbidden , so i guess the issue is with my htaccess file in my server. Now i understand that Openseaa like clients (erc1155 recievers) automatically convert the id to the 000..000id Format needed for all those platforms to work. Thank you