Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Mike Mc Posted August 10, 2021 Posted August 10, 2021 (edited) I have 2 custom fields created for my downloads files, i see that the database is saving the records in the 'downloads_ccontent' table. Using the API is there way to post new values for these fields when creating a new download through the REST API? I have tried a few variations of passing extra fields in the post data, and they do not seem to work. IE: the "Fields" array below $curl_post_data = array( 'category' => 2, 'author' => 1, 'title' => 'Test File Upload', 'description' => $file_desc, 'files' => array( $filename => urlencode(file_get_contents($file_url)), $filename2 => urlencode(file_get_contents($file_url2)) ), 'version' => '2021.02.06', 'screenshots' => array( 'testname.jpg' => urlencode(file_get_contents('/local/directory/')), 'testname2.jpg' => urlencode(file_get_contents('/local/directory/')) ), 'fields' => array ( 'field_1' => 'HERE IS THE DATA FOR FIELD 1', 'field_2' => 'HERE IS THE DATA FOR FIELD 2' ), 'prefix' => NULL, 'tags' => 'tag1, tag2, tag3', 'date' => NULL, 'ip_address' => NULL, 'locked' => 0, 'hidden' => 1, 'pinned' => 0, 'featured' => 0 ); Thanks!@Adriano Faria or @IPCommerceFan or @bfarber you all seem to have good API knowledge so i tagged you 😃 Edited August 10, 2021 by Mike Mc
Daniel F Posted August 27, 2021 Posted August 27, 2021 Were you able to resolve this in the meanwhile? If not, what's your current code?
Mike Mc Posted August 27, 2021 Author Posted August 27, 2021 I have a working solution, but I am just interfacing directly with the DB to save the information. It's hack but works for my purpose. I would have greatly appreciated using the API to update the custom fields but it appears the API is not capable.
Recommended Posts