# Authorization error when Registry api

**URL:** <https://forums.docker.com/t/authorization-error-when-registry-api/88437>\
**Category:** Docker Hub\
**Created:** [February 4, 2020, 5:50pm UTC](https://forums.docker.com/t/authorization-error-when-registry-api/88437 "2020-02-04T17:50:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dockering](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@dockering](https://forums.docker.com/u/dockering)\
**Post date:** [February 4, 2020, 5:50pm UTC](https://forums.docker.com/t/authorization-error-when-registry-api/88437/1 "2020-02-04T17:50:15Z")

</div>

Hi

I am trying to programmatically (REST api) determine the digest of an mysql image on docker’s public registry.

Here are some of the versions available

- [`8.0.19` , `8.0` , `8` , `latest`]
- [`5.7.29` , `5.7` , `5`]
- [`5.6.47` , `5.6`]

I use curl command to run the REST api as follows

curl -H “Accept: application/vnd.docker.distribution.manifest.v2+json” -k -v -X GET [https://registry.hub.docker.com/v2/repositories/mysql/manifests/latest](https://registry.hub.docker.com/v2/repositories/mysql/manifests/latest)

on execution I get the authorization error

{“errors”:[{“code”:“UNAUTHORIZED”,“message”:“authentication required”,“detail”:[{“Type”:“repository”,“Class”:“”,“Name”:“repositories/mysql”,“Action”:“pull”}]}]}

Here are some of the steps I took too solve the issue but all in-vain.

1. Using CLI I logged in to the docker registry and then ran the above curl command

2. Created a token and added to the postman as follows  
curl [https://auth.docker.io/token?service=registry.docker.io&scope=repository:mysql:pull,push](https://auth.docker.io/token?service=registry.docker.io&scope=repository:mysql:pull,push)

Can some one please provide some input on how i can resolve this

thanks
