FB API token system development guide
If you only want to manage ads but not BM, you need the marketing API.
Related articles
After managing mutual authorization through the BM API, you can let your own operations participate in the delivery (the marketing API also supports non-BM operations, that is, advertisers operate by themselves).
Marketing is divided into three situations according to different users:
1. Under BM, employees do not have FB accounts and do not want to associate FB accounts (FQ is required to log in to FB)
In this case, you can use system users, <BUSINESS_ID>/system_users System users are machine users (fake, virtual), you can associate your own system accounts with machine users, and then operate with the machine user’s token.
Authorization process:
a. Create a super-management system user through the super-management token (you can also go to the BM background provided by FB to create it manually)
b. Get the token of the super-management system user (you can also use the token of the super-management) to create a system user
c. Call the API to install the application for the system user
d. Generate the token of the system user (fill in the required authorization)
2. Under BM, employees have FB accounts and can authorize and bind accounts
3. Advertisers who want to manage their own ads
Both methods allow users to log in to FB accounts and authorize (manage_pages, ads_management, ads_read).
Then let’s get to the point
As mentioned earlier, FB api is REST style. Here are some important nodes:
/me #Represents the current authorized user
/act_<AD_ACCOUNT_ID> #Advertising account ID node
/<BUSINESS_SCOPED_USER_ID> #Note: Each user will be assigned a new user ID under each BM, and all operations under the BM must go through this user ID node
Common API list:
Copy code
//Get a list of manageable accounts
me/adaccounts?fields=id,name,users //You can view permissions based on users
<BUSINESS_SCOPED_USER_ID>/assigned_ad_accounts //(Compare with the same api for users under BM)
//Get manageable homepages (if authorized, available under all accounts in the name of the current user)
me/accounts
<BUSINESS_SCOPED_USER_ID>/assigned_pages
//Applications cannot be directly obtained, but applications that can be placed by a certain account can be obtained. The system will merge the applications associated with the authorized user + account
act_<AD_ACCOUNT_ID>/advertisable_applications
Copy code
The above basically explains all the structures before the placement, and the next step is the specific placement
After obtaining the current ad list, the subsequent placement is basically all centered around the ad account ID node (Note: the account ID must have an act_ prefix)
URL Meaning
act_<AD_ACCOUNT_ID>/campaigns
Defines campaign goals, including one or more ad groups
act_<AD_ACCOUNT_ID>/adsets
Ad groups: Contains all ads using the same budget, schedule, bid, and targeting criteria
act_<AD_ACCOUNT_ID>/ads
Ads: Ad data, such as creative elements and performance measurement information
act_<AD_ACCOUNT_ID>/adcreatives
Creatives: Defines the display effects and content of ads
act_<AD_ACCOUNT_ID>/adimages
Images: A library of images used in ad creatives. Can be uploaded and managed separately
act_<AD_ACCOUNT_ID>/advideos
Videos: A library of videos used in ad creatives. Can be uploaded and managed separately
act_<AD_ACCOUNT_ID>/users
A list of users associated with an ad account
act_<AD_ACCOUNT_ID>/insights
Interface for performance analysis. Delete duplicate data of child objects and provide organized asynchronous reports.
Performance reports are available at the ad account, series, group, and ad levels, and can be obtained according to /<***ID>/insights .
An interesting thing about FB’s API is that the child nodes under a node can usually be obtained by appending the fields= parameter to the node. For example, the act_<AD_ACCOUNT_ID>/users node mentioned above can be obtained through act_<AD_ACCOUNT_ID>?fields=users. I’ll save it as a tip.
API structure:
Taking the number of app installations as an example for marketing goals, the specific business structure is:
Green bottom frame: fixed option value
Orange bottom frame: search/need to be obtained through additional API
Red bottom frame: obtained through previous authorization relationship
For the information needed when adding ads and other content, FB’s development documents have detailed introductions:
The value of a certain field is a small number of fixed values, which need to be handled by the developer himself (such as: the delivery target of the ad campaign, the gender of the audience required in the ad group, are all fixed values)
The value of a certain field is a large number and will be updated regularly. FB provides an API for obtaining it (such as: the country in the audience, FB provides an API for obtaining all countries)
The value of a certain field is infinite and completely unfixed, which cannot be synchronized to the local by the developer. FB provides a search API (such as the API for obtaining the language. In fact, this API is similar to the above API, but with the addition of search parameters)
Temporary end: This is the end of the record of FB advertising API. The specific development code may be uploaded to github later. I am also new to FB. I hope you can correct me if I don’t understand it!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Attach some code snippets
//You can use batch (batch creation interface) when creating
$batch[‘batch’][] = array(
‘method’=>’POST’,
‘relative_url’=>'{{account_id}}/campaigns’,
‘body’=>http_build_query(…)
);
//Introduce several commonly used fields
batchCampaign
$fields = array(‘name’, ‘account_id’, ‘status’, ‘objective’,’special_ad_category’);
batchAdset
$fields = array(‘name’, ‘campaign_id’, ‘status’, ‘lifetime_budget’, ‘daily_budget’,’start_time’,<br>’end_time’, ‘bid_strategy’, ‘bid_amount’, ‘billing_event’, ‘optimization_goal’, ‘pacing_type’, ‘attribution_spec’, ‘targeting’, ‘promoted_object’); batchAd $fields = array(‘adset_id’, ‘name’, ‘status’, ‘creative’);
<<<<<<<<<<========Article Easter Egg===============
<<<<<<<=###################################################>>>>
Panda game goes out to sea. Advertising media agency account opening and advertising on ads.pandawm.com gathers over 20 types of overseas media advertising online accounts, including Facebook, Google, Twitter, TikTok, Line, Kwai, Skrill, Sumup, and more.
In addition, if you have any questions or concerns, please feel free to click on the contact us button below,
Wechat: szcwh99
Telegram: @panda0134
Gmail: pandagameads10@gmail.com
Whatsapp: +86 13928451944
How to increase the purchase volume of card and gambling games on Facebook, Google, Twitter, and TikTok?
#FB Undead Account, FB Undead Homepage, FB Undead Advertiser, # FB Whitelist #, # FB Three Unlimited #, # Google Old Account #, # Popin Account Opening Proxy #, # Dable Account Opening Proxy #, # Avivid Account Opening Proxy #, # Overseas Huawei Account Opening Proxy #, # Kwai Account Opening Proxy #,
#Overseas Game Distribution #, # Overseas Game Agency #, # Overseas Game Promotion #, # Overseas Game Placement #, # Overseas Game Package Network #, # Game Overseas Distribution #, # Game Overseas Distribution #, # Game Overseas Distribution #, # Game Overseas Distribution #, # Overseas Chess and Card Game Distribution #, # Overseas Gambling Game Promotion #, # Overseas Gaming Game Distribution #, # Overseas Real Gold Game Agency #, # Overseas Real Gold Game Promotion #, # Overseas Real Gold Game Placement #, # Overseas Sports Competition Game Distribution #, # Overseas Sports Competition Game Agency #, # Overseas Sports Game Promotion #, # Overseas Sports Game Placement #,
#India Indonesia game release #, # India Indonesia game investment and purchase volume#
#Brazilian game release #, # Brazilian game investment and purchase volume#
#Africa Middle East Game Release #, # Africa Middle East Game Investment and Purchase Volume#
#Southeast Asian Game Release #, Southeast Asian Game Investment and Purchase Volume#
Official website: www.pandawm.com
Community: facebook520.com
FB Network Account Opening: ads.pandawm.com
<<<<<<<<<<========Article Easter Egg===============
<<<<<<<=###################################################>>>>