Bug 23588 - REST API: Can't create a patron
Summary: REST API: Can't create a patron
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: 18.05
Hardware: PC Windows
: P5 - low major (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-11 10:53 UTC by Muhammad Danish
Modified: 2020-06-04 20:32 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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/