Adding a comment file through API with App authentication
AnsweredHi,
I am trying to add a comment with an attachment through the Podio API (using app authentication method) with the code below:
(...)
$podio_file_id = PodioFile::upload( $attachment['tmp_name'], $attachment['name'] );
$args = array(
'value' => $message,
);
if ( ! is_null( $podio_file_id ) ) {
$args['file'] = $podio_file_id;
}
return PodioComment::create( 'item', $ticket_id, $args );
(...)
When the upload is done I get a $podio_file_id, and the comment creation doesn't return any errors, however the comment is created without an attached file.
Is there anything wrong with the code or am I missing something else?
Thanks,
Marco
-
$args['file']
should be$args['file_ids']
and should contain an array offile_ids
. You can always look in the API reference documentation to see what data you should send: https://developers.podio.com/doc/comments/add-comment-to-object-22340/Andreas
Please sign in to leave a comment.
Comments
1 comment