1

Can anyone shade a light on how to use a Simple Query to request only the required fields of an asset with REST API. According to the documentation we need to include $fields element in the querystring with a value

Comma delimited string of asset properties used to reduce the size of your results to only the properties you need.

I have tried this

$fields='id,name'

but it does not eliminate the other fields.

The same problem exists in advanced query (check the request JSON below). The fields object is completely ignored.

{
    "page": {
        "page": 1,
        "pageSize": 50
    },
    "query": {
        "property": "sssetType.id",
        "simpleOperator": "equal",
        "value": 23
    },
    "fields": ["id",
    "name",
    "assetType",
    "createdDate",
    "modifiedDate",
    "category"],
    "sort": [{
        "property": "name",
        "direction": "ASC"
    },
    {
        "property": "modifiedDate",
        "direction": "DESC"
    }]
}

Any help would be appreciated.

0

Great question. I can't seem to get this to work either (I don't think you need quotation marks in your parameter values). Also you should not need to use a Simple Query if you want to return all assets.

I note that if I include a $fields parameter, it does return fewer name/value pairs then if I omit this parameter, but it does not appear to limit to the fields that you specify. Looks like this is a bug.

It looks like you will need to parse the response payload and then use the name/value pairs that you need.

  • 1
    Thanks Eliot, I have tried with quotation marks and without them, it dose not work. I have never had so many problems with API than with Marketing Cloud. So many things do not work, I hope their developers are monitoring this forums for reported bugs. – A.G. Jun 5 '17 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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