Creating objects in the REST API

Hi everyone. 

I'm having some trouble with the REST API. I'm getting an error I can't seem to figure out.
When I try to create an object, no matter what exactly the type or class is, I get an 500 error with code 154 in the text and also: 'Wrong data type for property definition "Name".'

My input payload is as follows:

{"PropertyValues":
           [{"PropertyDef": 0, "TypedValue": { "DataType": 1, "Value": 'test'}}
           ,
            {"PropertyDef ":  100,"TypedValue":{"DataType":9,"Lookup":{"Item":0,"Version":-1}}}]}
As far as I can see the DataType : 1 is correct for Property 0, which is the built-in property Name.
Does anyone know what this might cause this?
Parents
  • Hey mate,

    There is a space after propertydef in the quotations for the class section, once i removed that your call worked.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "PropertyValues": [
    {
    "PropertyDef": 0,
    "TypedValue": {
    "DataType": 1,
    "Value": 'test'
    }
    },
    {
    "PropertyDef": 100,
    "TypedValue": {
    "DataType": 9,
    "Lookup": {
    "Item": 0,
    "Version": -1
    }
    }
    }
    ]
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • Hey mate,

    There is a space after propertydef in the quotations for the class section, once i removed that your call worked.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "PropertyValues": [
    {
    "PropertyDef": 0,
    "TypedValue": {
    "DataType": 1,
    "Value": 'test'
    }
    },
    {
    "PropertyDef": 100,
    "TypedValue": {
    "DataType": 9,
    "Lookup": {
    "Item": 0,
    "Version": -1
    }
    }
    }
    ]
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children