There is any way to upload channel avatar by file url?

HI, we are using PHP curl request to creating channel and we did not found any way to upload channel avatar by a url, we have all images on cloud amazon s3,
is it possible to create channel avatar using image url?

@vibhorMaheshwari We recommend using Channel metadata to upload a channel avatar by file URL. For additional information, please visit the following link:

so if we add file url to meta data then its will display avatar automatically in IOS uikit?

Yes, except if you use avatarCustomUrl , you will need to modify the code on your end to facilitate this.

also im trying files upload api, it should be return a fileID but its giving me uploaded image below is my code:

function uploadFile($params = array())
    $url = $this->api_url.'/api/v3/files';

    $headers = array(
      'Accept: application/json',
      'Authorization: Bearer '.$this->admin_token,
      'cache-control: no-cache',
      'content-type: multipart/form-data'

    $fields = array();
    $fields['file']      = file_get_contents($params['file_url']);
    $fields['fullImage'] = true;
    // Open connection
    $ch = curl_init();

    // Set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch,CURLOPT_POSTFIELDS, $fields);

    // Execute post
    $response   = curl_exec($ch);
    $info       = curl_getinfo($ch);
    $error      = curl_error($ch);

    // Close connection

    $resp_array = json_decode($response, true);

    if($info['http_code'] == 200)
      $return = array('success' => true, 'response' => $resp_array);
      $return = array('success' => false, 'error_message' => $resp_array['message'], 'response' => $resp_array);        

    return $return;

public function upload_file()
		$params = array();
		$params['file_url'] = '';
		$amity_respon = $this->amity_api->uploadFile($params);

@vibhorMaheshwari I will consult with my team regarding this matter and revert to you with an update.

@vibhorMaheshwari Upon consulting with our team, we kindly suggest that you export the log response and take another look. You should be receiving a File ID as part of the response. We’re here to assist further if you need any help with this process.

you can check below screen shot that i am getting http code 200 , but in response there is only image data nothing else.

Hello, could you please try this endpoint instead:

curl --location ‘
–header ‘accept: application/json’
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer cxxx’
–form ‘files=@“/path/to/file”’

tired this given code, but not succeed, now i am receiving a new error:

{ “status”: “error”, “message”: “Access token is invalid.”, “code”: 400100, “data”: { “detail”: { “appErrorCode”: 400100 } } }

but when i use my previous endpoint ( then it success but not getting fileID.

May I ask where did you get the Access token from? And did you pass the Access token when you call endpoint?

same token passed on both api endpoints.
we have get this token from here:


Pls try this

tried this endpoint ( and getting same response,

can you please tell me what i need to do?
we are stuck on this.

Hello, could you please help test this using postman? and see if it returns correctly?

yes its wokring on postman, thanks for support, now i will figure out what the issue with PHP curl request.

1 Like