Is it possible to add entries into categories when creating them with the Channel Entries API cant see anything in the documentation.


Within the channel entry API, you can pass the data array containing the array of category ids like:


$data = array(
    'title'         => 'ENTRY TITLE',
    'entry_date'    => time(),
    'channel_id'    => x,
    'category'      => array($category_id)

ee()->api_channel_fields->setup_entry_settings($channel_id, $data);

ee()->api_channel_entries->submit_new_entry($channel_id, $data);

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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