ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
![]()
CCA is situated on the traditional unceded lands of the Chochenyo and Ramaytush Ohlone peoples.
Black-owned bookstores in Oakland: Ashay by the Bay, Marcus Books
:(){ :|: & };:
_______________________________________________Dear All,Hope this email finds you well. I am facing a error koha rest api , I explained below -I use the below code base for the koha rest api . When I check the bywater koha demo site's rest api, it's working fine but When I checked my demo koha site, getting authentication error(401)I entered the correct client id and secret ssl certificate installed correctly. My api worked properly using the chrome RESTer tool. Thanks in advance .import requestsimport jsonimport osfrom requests.structures import CaseInsensitiveDictimport http.clientconn = http.client.HTTPSConnection("https://******:8080")#from dotenv import load_dotenv#load_dotenv()data = {"client_id": "e877bce0-78bc-4d39-a0c1-2df7fccb1397","client_secret": "461cda1a-665d-4d24-a0e0-dace5f83a1f4","grant_type": "client_credentials",}response = requests.post("https://{mydomain}/api/v1/oauth/token", data=data)credentials = response.json()print(credentials)access_token = credentials['access_token']print("Access_token: ",access_token)#auth2 = CaseInsensitiveDict()auth2={"content-type":"application/json","authorization": f"Bearer {access_token}"}print(auth2)response = requests.request("GET", "https://{mydomain}:8080/api/v1/patrons", headers=auth2)print(response)Regrads,Esharat Mia
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/