# No result from https://hub.docker.com/v2/repositories

**URL:** <https://forums.docker.com/t/no-result-from-https-hub-docker-com-v2-repositories/119061>\
**Category:** Docker Hub\
**Tags:** dockerhub\
**Created:** [December 22, 2021, 9:56am UTC](https://forums.docker.com/t/no-result-from-https-hub-docker-com-v2-repositories/119061 "2021-12-22T09:56:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![autesagar](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/autesagar/32/32530_2.png) [@autesagar](https://forums.docker.com/u/autesagar)\
**Post date:** [December 22, 2021, 9:56am UTC](https://forums.docker.com/t/no-result-from-https-hub-docker-com-v2-repositories/119061/1 "2021-12-22T09:56:12Z")

</div>

Not able to fetch digetID from URL **[https://hub.docker.com/v2/repositories/{RepositoryName}/{DockerImageName}/tags/{Version}](https://hub.docker.com/v2/repositories/%7BRepositoryName%7D/%7BDockerImageName%7D/tags/%7BVersion%7D)**  
Getting below message **{“errinfo”:null,“message”:“object not found”}**

Earlier I used to fetch digest id and image related information to validate docker image. But now we are not getting result from _https+hub.docker.com+v2+repositories+{RepositoryName}/{DockerImageName}/tags/{Version}_ to validate docker image.

This URL is working for Open source Repository i.e. mongo  
**[https://hub.docker.com/v2/repositories/library/mongo/tags/latest/](https://hub.docker.com/v2/repositories/library/mongo/tags/latest/)**  
but not working for private repository.

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 23, 2021, 3:47pm UTC](https://forums.docker.com/t/no-result-from-https-hub-docker-com-v2-repositories/119061/2 "2021-12-23T15:47:31Z")

</div>

The API endpoint doesn’t use the normal session so you have to authenticate yourself using a token. You can use this script:

```bash
#!/usr/bin/env bash

echo -n "Username: "
read -r username

echo -n "Password: "
read -rs password
echo

echo -n "Repository: "
read -r repository

auth_request="$(echo '{}' | jq --arg username $username --arg password $password '{"username": $username, "password": $password}')"

token=$(curl -s -H "Content-Type: application/json" -X POST -d "$auth_request" https://hub.docker.com/v2/users/login/ | jq -r .token)

curl -s -H "Authorization: JWT $token" "https://hub.docker.com/v2/repositories/$repository/tags/latest"

```

It will ask for username, password and the name of the repository.

**Note:** It requires “jq”

I have read this [DockerHub Docker Registry API Examples](https://www.arthurkoziel.com/dockerhub-registry-api/)  
to create my version of the script.

You could also use hub-tool but it does not support setting the version tag:

```bash
hub-tool tag ls your/repository_without_tag --format json

```
