Skip to end of banner
Go to start of banner

POST contact_information/profile_photo/add

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

POST contact_information/profile_photo/add

Available from CRM.COM R11.0.0

This method is used to add a profile photo on an existing contact information. This Web API method requires a multipart/form-data post, as defined in RFC 1867. There are many libraries available that can be used in order to submit multipart/form-data posts (for example MultipartEntity in Java). A single contact information can be updated through each call

Resource URL

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

contact_information_identifier

(mandatory)

Identifier  

The identifier of the contact information that should be updated. The allowed contact information identifier fields are the following:

Name

Type

Description

id 

(semi-optional)

String

The ID of the contact information

id_number

(semi-optional)

String

The ID number of the contact information

Applicable only for contact information that represent PERSON

passport_number 

(semi-optional)

String

The passport number of the contact information

Applicable only for contact information that represent PERSON

social_security_number 

(semi-optional)

String

The social security number of the contact information

Applicable only for contact information that represent PERSON

vat_registration_number

(semi-optional)

String

The VAT registration number of the contact information

Applicable only for contact information that represent COMPANY

registration_number

(semi-optional)

String

The registration number of the contact information

Applicable only for contact information that represent COMPANY

Available from CRM.COM R14.0.0

file

(semi-optional)

FileThe file that should be added as a profile picture

fields_set
(optional)

List of Strings, comma separated 

A list of fields that should be included in the results. If not specified then all the available fields will be returned

Restrictions

  • It is mandatory to specify one of the semi-optional parameters. Only one of those parameters is allowed to be specified.

Response Data

Name

Type

Description

file_nameStringThe name of the file
file_content_urlStringThe url that can be used to access the actual content of the file
file_mime_typeStringThe mime type of the attached file

Examples

 Example 1

cURL Example:

curl --request POST \
  --url https://r11qa.crm.com/crmapi/rest/v2/contact_information/profile_photo/add \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form 'file=@[object Object]' \
  --form contact_information_identifier=id=18686813304341ECAFC8175A85594C9B \
  --form 'token=C9464BFEC45F49989AAB17E1C54FA4D0' 

 

PHP Example:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://r11qa.crm.com/crmapi/rest/v2/contact_information/profile_photo/add",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: false\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contact_information_identifier\"\r\n\r\nid=18686813304341ECAFC8175A85594C9B\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"token\"\r\n\r\nC9464BFEC45F49989AAB17E1C54FA4D0\r\n-----011000010111000001101001--",
  CURLOPT_HTTPHEADER => array(
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
  • No labels