to_api_array function

Convert a vector to the array format expected by the REDCap API