Pictures API V2 call
You can use the Pictures API call to upload pictures to your Wild Apricot account, and to download pictures from picture fields. To upload a picture to a picture field for a particular contact, use the Contacts API call.
Uploading a picture
You can use the Pictures API call to upload one or more pictures to your Wild Apricot account.
One or more pictures can be uploaded using a multipart/form-data POST request, with the Content-Type header set to multipart/form-data. The multipart/form-data request contains a series of parts, with each part representing a different picture. Each part must contain a Content-Disposition header whose value is form-data, and a Content-Type header that begins with the image/ and includes the mime type. Supported types are: png, jpeg, bmp. The mime type must match the actual picture content.
One of the part's properties – Name or Filename – must be set and at least one property must have a unique value. If the same Name is used in multiple parts, but different Filenames are specified, then the pictures in both parts will be uploaded. If the same Name and Filename are used in multiple parts, then only the picture in the first part will be uploaded.
- Maximum size for each picture is 10mb.
- Maximum request length is 10mb. That means that you can upload one 10mb picture or 10 pictures of 1mb each.
- There are no limits on the dimensions of the uploaded picture, but each picture will be resized to 110px after uploading.
- Supported picture types are: png, jpeg, bmp. All bmp pictures will be converted to png format.
If successful, the call returns the IDs of the uploaded pictures.
The numbers of the picture identifiers on the left correspond to the order of the parts in your original call. In the above example, 4 parts were included in the call, but the third part was not valid and its picture was not uploaded.
The picture will be available for use 30 minutes after uploading.
Assigning pictures to picture fields
After a picture has been uploaded, it can be assigned to a picture field. Each uploaded picture can be assigned to a picture field only once. After it is assigned to a picture field, the picture will no longer be accessible using that picture ID.
To assign a picture to a picture field, you use the Contacts API call and follow the instructions to update a contact record. Within the FieldValues section, specify the name of the picture field to be updated and provide the picture ID as the field value.
Downloading a picture
You can use the Pictures API call to download a picture assigned to a picture field in your account.
To download the picture in BASE64 format, add ?asBase64=true to the end of the API call.
If successful, the call returns a common HttpResponseMessage with content set to the picture binary data.
The following parameters are used within the Pictures API call:
The base address of the API. For more information, see API access options .
|pictureID||The unique identifier assigned to a picture in a picture field. Pictures IDs can be returned as a field value using version 2.1 of the Contacts API call.|