Aswin - are you using the correct URL to call your custom endpoint. It should 
be under the contrib namespace e.g.

https://<SERVERNAME>/api/v1/contrib/<customname>

Stephen


-----Original Message-----
From: Koha <koha-boun...@lists.katipo.co.nz> On Behalf Of Aswin Unnikrishnan
Sent: 17 May 2021 13:40
To: Discussion Group Koha <koha@lists.katipo.co.nz>
Subject: [Koha] Koha API - Authentication Failure

Hi,

I wanted to build an app that uses the koha API, and so i was testing it out, 
but I keep getting "Authentication Failure" error whichever end point I try to 
access.
The steps i did are

1. Got the client_id / secret from koha
2. Sent a POST request to api/v1/oauth/token with required parameters and got  
an "access_token" returned 3. Added the token to my authorization header with 
header-prefix "Bearer"
4. Sent a GET request to different end points, but getting the same 401 
Unauthorized error code with error : Authentication failure

However if i access one of the public end points like 
/api/v1/biblios/{biblio_id} i can get a response

If anyone has any idea why this is happening, please  let me know.

Thanks in advance,
Aswin
_______________________________________________

Koha mailing list  http://koha-community.org Koha@lists.katipo.co.nz
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________

Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha

Reply via email to