EPrints Technical Mailing List Archive
Message: #07078
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Q: Updating fields using the REST API
- To: Christopher Gutteridge <cjg@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Q: Updating fields using the REST API
- From: "rsdoiel@caltech.edu" <rsdoiel@library.caltech.edu>
- Date: Wed, 10 Jan 2018 08:54:03 -0800
Thanks, I'll try that next. I've started to read through the Perl (I'm a bit rusty) to understand the details too. When I solve it I'll post something to the list hear as I notice this crops up everyone year or two.
All the best,
Robert Doiel
On Wed, Jan 10, 2018 at 3:27 AM, Christopher Gutteridge <cjg@ecs.soton.ac.uk> wrote:
I think you might have to put a whole field at a time, but it's many years since I've looked at this so it may have changed!
I'm guessing you can get the syntax via: GET /authors/rest/eprint/1/
creators CRUD operations on the EPrints 3.3.15 REST API
Happy New years everyone,
I have a question about using the REST API to update an EPrints collection (EPrints 3.3.15).I'd like to update the value of the ID field for /rest/eprint/#####/creators/#####/id.txt and when I try to put (id.txt currently is empty) I get an errorlike
curl -v -u epautomation:testrepo -d "Moore-R-L" -X PUT http://lemurprints.local/authors/rest/eprint/1/ creators/1/id.txt * Trying 172.28.128.4...* TCP_NODELAY set* Connected to lemurprints.local (172.28.128.4) port 80 (#0)* Server auth using Basic with user 'epautomation'> PUT /authors/rest/eprint/1/creators/1/id.txt HTTP/1.1 > Host: lemurprints.local> Authorization: Basic ZXBhdXRvbWF0aW9uOnRlc3RyZXBv> User-Agent: curl/7.57.0> Accept: */*> Content-Length: 9> Content-Type: application/x-www-form-urlencoded >* upload completely sent off: 9 out of 9 bytes< HTTP/1.1 501 Method PUT Not Implemented< Date: Mon, 08 Jan 2018 23:36:53 GMT< Server: Apache/2.4.7 (Ubuntu)< Content-Length: 0< Connection: close<* Closing connection 0
Doing a similar command to changed the "referred" field does work (flipping the value from TRUE to FALSE).
curl -v -u epautomation:testrepo -d "TRUE" -X PUT http://lemurprints.local/authors/rest/eprint/1/ refereed.txt * Trying 172.28.128.4...* TCP_NODELAY set* Connected to lemurprints.local (172.28.128.4) port 80 (#0)* Server auth using Basic with user 'epautomation'> PUT /authors/rest/eprint/1/refereed.txt HTTP/1.1 > Host: lemurprints.local> Authorization: Basic ZXBhdXRvbWF0aW9uOnRlc3RyZXBv> User-Agent: curl/7.57.0> Accept: */*> Content-Length: 4> Content-Type: application/x-www-form-urlencoded >* upload completely sent off: 4 out of 4 bytes< HTTP/1.1 200 OK< Date: Mon, 08 Jan 2018 23:42:56 GMT< Server: Apache/2.4.7 (Ubuntu)< Cache-Control: no-store, no-cache, must-revalidate< Vary: Accept-Encoding< Transfer-Encoding: chunked< Content-Type: text/plain; charset=UTF-8<* Connection #0 to host lemurprints.local left intact
I am probably missing something obvious but any help would be appreciated.
Thanks,
Robert
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints- *** Archive: http://www.eprints.org/tech.tech php/ *** EPrints community wiki: http://wiki.eprints.org/ *** EPrints developers Forum: http://forum.eprints.org/
-- Christopher Gutteridge -- http://users.ecs.soton.ac.uk/cjg University of Southampton Open Data Service: http://data.southampton.ac.uk/ You should read our Web & Data Innovation blog: http://blogs.ecs.soton.ac.uk/webteam/
- Follow-Ups:
- Re: [EP-tech] Q: Updating fields using the REST API
- From: "rsdoiel@caltech.edu" <rsdoiel@library.caltech.edu>
- Re: [EP-tech] Q: Updating fields using the REST API
- References:
- [EP-tech] Q: Updating fields using the REST API
- From: "rsdoiel@caltech.edu" <rsdoiel@library.caltech.edu>
- Re: [EP-tech] Q: Updating fields using the REST API
- From: Christopher Gutteridge <cjg@ecs.soton.ac.uk>
- Re: [EP-tech] Q: Updating fields using the REST API
- From: "rsdoiel@caltech.edu" <rsdoiel@library.caltech.edu>
- [EP-tech] Q: Updating fields using the REST API
- Prev by Date: Re: [EP-tech] Q: Updating fields using the REST API
- Next by Date: Re: [EP-tech] IRStats2 update - how to upgrade
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):