creatives, filename, hash, id, url
Returns the image hash to which AdCreative's can refer.
image = AdImage('1505766289694659:e696138d3b4b330cd2be94107ccf4aaf') image.remote_read() image_hash = image.get_hash() print image_hash
Uploads filename and creates the AdImage object from it.
It has same arguments as AbstractCrudObject.remote_create except it does not have the files argument but requires the 'filename' property to be defined.
Name | Type | Description | Required |
---|---|---|---|
|
| A FacebookAdsApiBatch object. If specified, the call will be added to the batch. | No |
|
| A callback function which will be called with the FacebookResponse of this call if the call failed. | No |
|
| An optional mapping of file names to binary open file objects. These files will be attached to the request. | No |
|
| A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded. | No |
|
| A callback function which will be called with the FacebookResponse of this call if the call succeeded. | No |
|
| The version of the API to use. | No |
image = AdImage(parent_id='act_1505766289694659') image[AdImage.Field.filename] = '/tmp/tmp-python-ads-sdk/facebookads/test/test.png' image.remote_create() print image
Returns object for each image in a zip for an ad's creative
Name | Type | Description | Required |
---|---|---|---|
|
| The path to a local file on the machine. | Yes |
|
| The ID of the account in which you are creating this object. This value should be 'act_' prepended. | Yes |
|
| A FacebookAdsApi instance. | No |
images = AdImage.remote_create_from_zip( filename='/tmp/tmp-python-ads-sdk/facebookads/test/test.zip', parent_id='act_1505766289694659', ) print images
Name | Type | Description | Required |
---|---|---|---|
|
| A FacebookAdsApiBatch object. If specified, the call will be added to the batch. | No |
|
| A callback function which will be called with the FacebookResponse of this call if the call failed. | No |
|
| A list of fields to read. | No |
|
| A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded. | No |
|
| A callback function which will be called with the FacebookResponse of this call if the call succeeded. | No |
|
| The version of the API to use. | No |
image = AdImage('1505766289694659:e696138d3b4b330cd2be94107ccf4aaf') image.remote_read() print image