Bug 23588

Summary: REST API: Can't create a patron
Product: Koha Reporter: Muhammad Danish <danish.qayyam>
Component: REST APIAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P5 - low CC: tomascohen
Version: 18.05   
Hardware: PC   
OS: Windows   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Muhammad Danish 2019-09-11 10:53:38 UTC
Hi!

I am trying to create a new Patron but everytime getting Bad Request. What I am missing. Here is my C# code:

 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
 request.CookieContainer = cookieJar;
 request.Method = "POST";
 request.ContentType = "application/json";


System.IO.StreamWriter writer = new System.IO.StreamWriter(request.GetRequestStream());

            string postData = "{'surname': 'D2','cardnumber':'12345678912345678912345678912349','library_id':'GBA','category_id':'HB','date_enrolled':'11/09/2019'}";


            writer.Write(json);
            writer.Flush();
            writer.Close();
   HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Comment 1 Muhammad Danish 2019-09-11 10:54:31 UTC
I am using API: api/v1/patrons
Comment 2 Katrin Fischer 2019-09-15 19:32:37 UTC
I have changed the bug for better visibility, but this question would be better asked on the mailing list!
Comment 3 Katrin Fischer 2019-10-11 05:26:40 UTC
Hi Muhammed, checking this again, this sounds like a support request rather than a bug.

Questions about Koha configuration are best asked on the Koha mailing list (http://koha-community.org/support/koha-mailing-lists/) or in the #koha IRC channel (http://koha-community.org/get-involved/irc/).

Hopefully you've already seen the Koha documentation: http://koha-community.org/documentation/

You can also find options for paid support here: https://koha-community.org/support/