Image uploaded using /api/upload api is not getting linked to a particular entry of a collection

System Information
  • Strapi Version: 4.0.2
  • Operating System: ubuntu 18.04.1 LTS (Bionic Beaver) 64-bit
  • Database: mysql
  • Node Version: 14.16.1
  • NPM Version: 6.14.12
  • Yarn Version: 1.22.10

Whenever i try to upload an image using the /api/upload api with the ref, refId, files and field parameters it gets uploaded to the media library properly but it is not getting linked to the entry which i mentioned in the refId. I want the image to be linked to the entry of a collection. There is one more question i.e in the documentation the refId is given like this “5c126648c7415f0c0ef1bccd” but i am not able to find any id with this format please let me know how i can find this type of id for an entry.