gs1 / GS1_DigitalLink_Resolver_CE

The GS1 DigitalLink Resolver Community Edition
Apache License 2.0
41 stars 26 forks source link

Cannot access API #65

Closed ablears closed 6 months ago

ablears commented 1 year ago

Hi, thanks for providing this community edition.

I am using the Postman collection based on the API docs to send a test POST to {{base_url}}/resolver using the provided example.

I set the Authorization to Bearer Token with value MyAdminAuthKey as specified in resolver_data_entry_server/Dockerfile.

However, this is not successful. {"success":false,"error":"Unauthorized Access (Forbidden)"}

I found I can access the ADMIN endpoints without issue, for example GET {{base_url}}/admin/heardbuildsyncservers. And for the other endpoints it's a mix of OK and error, for example:

Can anyone point me in the right direction to fix this?

nicklansley commented 1 year ago

Hi, apologies for the delay in replying

/resolver and /redirect APIS need you to use an authorization key that matches one in the accounts table. ADMIN authorization only works for the ADMIN APIs.

I hope this helps!