[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Handle-info] Modify handle value via API
That API takes a handle record in the same format as the result of the GET. You can include just the values, thus:
{"values":[ {"index":1,"type":"URL","data":{"format":"string","value":"http://www.zzz.edu”}} ]}
The confusing error message results from the server interpreting your JSON object as a handle record with no values. We'll look into better handling of this in future versions.
Robert
> On Feb 16, 2016, at 11:18 AM, Brian Sheppard <brian.sheppard@wisc.edu> wrote:
>
> Any insight would be appreciated:
>
> I’m trying to modify a handle value via the API and am receiving a 400, with the message:
>
> "java.lang.Exception: Mismatched indexes in PUT request"
>
>
> json payload:
> {"index":1,"type":"URL","data":{"format":"string","value":"http://www.zzz.edu”}}
>
> As an experiment, I changed the index value to a quoted string, to no effect. I also tried creating the value at an unused index. Same response.
>
> Request URI (method PUT)
> https://128.104.47.219:8000/api/handles/1712/test2?index=1
>
> I’ve confirmed I can delete using the same credentials.
>
> The GET for the target handle:
> {
> "responseCode": 1,
> "handle": "1712/test2",
> "values": [
> {
> "index": 1,
> "type": "URL",
> "data": {
> "format": "string",
> "value": "http://ezproxy.library.wisc.edu/login?url=http://qqqq.com"
> },
> "ttl": 86400,
> "timestamp": "2016-02-16T15:51:40Z"
> }
> ]
> }
>
>
> Thanks.
> -Brian
>
> —————————————————————————————
> Brian Sheppard
> UW Digital Collections Center
> brian.sheppard@wisc.edu
>
>
>
>
>
> _______________________________________________
> Handle-Info mailing list
> Handle-Info@cnri.reston.va.us
> http://www.handle.net/mailman/listinfo/handle-info
_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info