I have a SharePoint 2013 page that I want to make updates to a hyperlink field in a list. I'm calling the REST API using JavaScript + jQuery.

My code (my hyperlink field is Timesheet_x0020_Page):

self.UpdateTimesheet = function(id, state) {
    var data = {
        '__metadata': { 'type': 'SP.Data.TimesheetListItem' },
        'Timesheet_x0020_Page': 'http://google.com, Google',
        'State': state
    var url = "/_api/Web/Lists(guid'e95f5b86-64dd-41d9-9973-493d906ce75e')/Items(" + id + ")";
    var promise = $.ajax({
        'url': url,
        type: "POST",
        contentType: "application/json;odata=verbose",
        data: JSON.stringify(data),
        headers: {
            "Accept": "application/json;odata=verbose",
            "X-HTTP-Method": "MERGE",
            "IF-MATCH": "*",
            "X-RequestDigest": $("#__REQUESTDIGEST").val()
    return promise;

But I get the following error:

{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected."}}}

1 Answer 1


You should try to using this. It may help you:

 var data = {
        '__metadata': { 'type': 'SP.Data.TimesheetListItem' },
                    '__metadata': { 'type': 'SP.FieldUrlValue' },
                    'Description': 'Google',
                    'Url': 'http://google.com'
        'State': state
  • Interested to see if that fixes it. I had the same issue earlier this week (calling from workflow). Rest API documentation really needs to be beefed up.
    – Russell
    Jan 23, 2014 at 2:58
  • 3
    Yep that was it, thanks. Pretty interesting that values can have __metadata object.
    – Kit Menke
    Jan 23, 2014 at 3:05
  • Is there a web site we can go to learn or see more metadata combinations for various columns, not just hyperlinks? but for example, images...?
    – klewis
    Mar 24, 2021 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.