How can i get not boxnote type in boxnote API?

20 Views Asked by At

I'm using Airtable for getting my box files. I can get the boxnote type but the not boxnote type, i can't get it. Here's my code:

const query = async( type, item, query = {} ) => {
    const key = type === 'list' ? 'folder' : type

    console.log("test log :>> ", {connection: connectionId, [key]: item, query})
    try {
        const res = await fetch( `${urlRoot}/${type}`, {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${apiKey}`,
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({connection: connectionId, [key]: item, query})
        })
        return await res.json()
    } catch( err ) {
        console.log('Query Error', type, item, query, err)
    }
}

let noteFiles = await query('search', 'boxnote', {
    ancestor_folder_ids: folderIds.join(","), 
    file_extensions: 'boxnote', 
    updated_at_range:lastModified,
    all:true,
    fields: "id,name,type,created_at,parent,path_collection,owned_by,created_by,content_modified_at,comment_count,extension,item_status,modified_at,modified_by,size"
})
console.log('Note Files', noteFiles)


let clientFiles = await query('search', 'NOT boxnote', {
    ancestor_folder_ids: folderIds.join(","), 
    updated_at_range:lastModified,
    all:true,
    fields: "id,name,type,created_at,parent,path_collection,owned_by,created_by,content_modified_at,comment_count,extension,item_status,modified_at,modified_by,size"
});
console.log('Client Files', clientFiles)

This is the log of note and client files:

"Note Files"
{total_count: 9, entries: Array(9), limit: 200, offset: 0, type: "search_results_items"}

"Client Files"
{error: "Unexpected API Response [400 Bad Request | lvw3gihmiaed5fyu.075e4969f821267f53ac46597acf7dc3c] bad_request - Bad Request"}

I tried to search for getting not boxnote type but I can't see any resources to make reference.

0

There are 0 best solutions below