Used document_category_to_id() function of library/documents.php script.