Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Missing Property(mime_type) from Property Filter. Content Server API v2.

0
Posted Sep 28 by Jeremy Pedro.
Updated Sep 28.

When you make a call like api/v2/nodes/{{NodeID}}/nodes?fields=properties the response looks like this.

    results: [
    {
        data: {
            properties: {
                container: false,
                container_size: 0,
                create_date: 2017-08-18T09:28:24,
                create_user_id: 1000,
                description: '',
                description_multilingual: {
                    en_US: ''
                },
                external_create_date: null,
                external_identity: '',
                external_identity_type: '',
                external_modify_date: null,
                external_source: '',
                favorite: false,
                id: 9674,
                mime_type: 'application/pdf',
                modify_date: 2017-09-26T16:21:28,
                modify_user_id: 30621,
                name: '0001.pdf',
                name_multilingual: {
                    en_US: '0001.pdf'
                },
                owner_group_id: 3655,
                owner_user_id: 1000,
                parent_id: 6387,
                reserved: false,
                reserved_date: null,
                reserved_user_id: 0,
                size: 336710,
                size_formatted: '329 KB',
                type: 144,
                type_name: 'Document',
                versions_control_advanced: false,
                volume_id: -2000
            }
        }
    }
]

Now there is a system in place to limit the amount of fields by doing something like this api/v2/nodes/{{NodeID}}/nodes?fields=properties{id, name, create_date}

 results: [
    {
        data: {
            properties: {
                create_date: 2017-08-18T09:28:24,
                id: 9674,
                name: '0001.pdf'
            }
        }
    }
]

But when I add in mime_type to api/v2/nodes/{{NodeID}}/nodes?fields=properties{id, name, create_date, mime_type}

results: [
    {
        data: {
            properties: {
                create_date: 2017-08-18T09:28:24,
                id: 9674,
                name: '0001.pdf'
            }
        }
    }
]

You can see that the mime_type property is not returned with the response. So I guess my question is why? I can only assume it is because that not every node type has a mime_type property and it was just easier to leave it out of the endpoint then check every node type to see if it has a mime_type. Maybe this was just an oversight or it is indeed a bug. But if this is something that is going to be fixed that would be great because I am using the mime_type to add icons to to my UI and if I can filter out everything but id, name, and mime-type I would see a boost to performance.


 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.

Statistics

Related categories

Related tags

Your answer

To leave an answer, please sign in.