forked from bonechopper/ads-api-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Readme.txt
83 lines (57 loc) · 2.64 KB
/
Readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Readme File for Facebook Ads API Sample Code
-------------------------------------------------------------
The Facebook Ads API is currently in a closed beta. If you would
like to have an application enabled for the Facebook Ads API;
please go to: http://developers.facebook.com/docs/adsapi
and follow the instructions.
This repository contains the open source Ads API Sample code that
allows you to utilize the above on your website. Except as
otherwise noted, the Facebook Ads API Sample code is licensed
under the Apache Licence, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.html)
This sample code is built using the Facebook PHP-SDK v3.x
available at http://github.com/facebook/php-sdk. Please checkout
the php-sdk first and copy the src/facebook.php file in the ./inc
directory.
The source code is provided as a reference.
Directories and Files
images/
login.gif - login image for facebook connect
logout.gif - logout image for facebook connect
inc/
Prevent direct access to inc/ through web server config.
adlib.php - implementation for the advertising API
common.php - Initialization functions for the library
base_facebook.php & facebook.php - these are the
facebook php-sdk files.
Please see http://github.com/facebook/php-sdk
header.php - common header file to print the html
header, essential java script for facebook connect
includes.php - include all relevant files
tmp/
Web Server should be able to write to tmp/
Empty directory for temporary image uploads
./
create_campaign.php - create a campaign example
index.php - ads sample app home page
create_adgroup.php - create an ad example
multi_create_batch.php - Example for creating
multiple adgroups with a single batch call
Getting Started
Please refer to: http://developers.facebook.com/docs/adsapi
To get started with the ads api, modify the common.php file
to enter your application ID and secret. Make sure that the
base domain is set for the Facebook app to base domain where
the code is hosted. Please follow instructions listed here
to setup your application -
http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site#Setting_Up_Your_Application_and_Getting_an_API_Key
Point your browser to the index.php file and that's it.
Any questions - please email ads-api-bugs@publists.facebook.com
FAQ:
Q) I am getting an error even after granting permissions to the
application "Fatal error: Uncaught Exception: 294:
Managing advertisements requires the extended permission
ads_management, and a participating API key"
A) Make sure you've accepted the terms; please refer to
"Agreeing to the Ads API Terms" on
http://developers.facebook.com/docs/adsapi