Hi Mei Mei,
The API you linked allows to upload individual assets meaning layers, manifests, tags. An image tar file is not a single asset. If you want to use the API then you have to upload each individual layer, manifest, and tag separately. If you want to just upload whole image then use a Docker client.