facebook ads api
api测试
https://developers.facebook.com/tools/explorer/517735271920003?method=GET&path=act_1107316072738457%2Finsights%3F%26fields%3Dclicks%2Cimpressions%2Cspend%26level%3Daccount%26breakdowns%3D%26time_increment%3D1%26time_range%3D%7B'since'%3A'2017-11-26'%2C'until'%3A'2017-12-26'%7D&version=v2.11

me/adaccounts
#getting ad accounts 获取到ad node
2、FB.api('/me/adaccounts'); FB.api('/me/adaccounts?fields=id,name'); FB.api('act_221377094983518?fields=id,name');
#creating campaigns 创建广告系列
3、FB.api('/act_221377094983518/campaigns', 'POST', {'name':'我的广告','objective':'LINK_CLICKS'}); MOBILE_APP_INSTALLS、CONVERSIONS等
#updating campaigns 修改广告系列的相关设置
4、FB.api('23842545377820361', 'POST', {'status':'PAUSED'}); //暂停
app 添加products:marketing api

添加account授权


获取token




获取userid、过期时间、short time access token

获取long time user access token:(60天有效期)
oauth/access_token?grant_type=fb_exchange_token&client_id=***********&client_secret=********&fb_exchange_token={short-time-access-token}
获取app access token:
oauth/access_token?client_id=********&client_secret=**********&grant_type=client_credentials
获取short time user access token:(2小时有效期)
登陆=》调用callbackurl,给出accesstoken=》添加app id、app secret后获取long time access token=》保存=》调用接口使用
类似授权登陆的流程
接口调用,graph api explorer可以不用添加param:access_token={valid access token}
me/adaccounts
{user id}/adaccounts
act_{ads account id}/users
/// <summary>
/// SystemUserId or UserId.
///
///( SystemUserId
/// https://graph.facebook.com/API_VERSION/BUSINESS_ID/system_users
/// ref:https://developers.facebook.com/docs/marketing-api/businessmanager/systemuser)
///
///( UserId
/// ref:https://developers.facebook.com/docs/graph-api/reference/user/
/// https://graph.facebook.com/API_VERSION/me/ids_for_business)
/// </summary>
act_{ads account id}/insights?
act_{ads account id}/insights?fields=account_id,account_name,campaign_id{cost_per_action,results},campaign_name,date_stop,date_start,clicks,impressions,total_action_value,total_actions,spend,actions,action_values,website_purchase_roas,reach&level=account&breakdowns=&time_increment=1&action_attribution_windows=1d_view,28d_click,default&time_range={'since':'2018-01-01','until':'2018-01-22'}
#facebook 获取report
curl "https://graph.facebook.com/v2.11/act_1534433596654710/insights?access_token=************************&fields=account_id,account_name,campaign_id{cost_per_action,results},campaign_name,d
ate_stop,date_start,clicks,impressions,total_action_value,total_actions,spend,actions,action_values,website_purchase_roa
s,reach&level=account&breakdowns=&time_increment=1&action_attribution_windows=1d_view,28d_click,default&time_range={'sin
ce':'2018-01-01','until':'2018-01-29'}"
https://developers.facebook.com/docs/applinks/metadata-reference
https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/debugging-tools/event_statistics/v2.12
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/insights/
https://developers.facebook.com/docs/marketing-api/reference/ad-report-run/
https://developers.facebook.com/docs/marketing-api/targeting-specs
https://developers.facebook.com/docs/marketing-api/targeting-search#country_group
https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/ #action_device
facebook ads api的更多相关文章
- Facebook广告API系列 3 Ads Management
Facebook广告API系列 3 Facebook marketing API有三大组成部分: Audience Management Ads Management Ads Insights 本篇介 ...
- Facebook广告API系列 2 - Audience Management
Facebook广告API系列 2 Facebook marketing API有三大组成部分: Audience Management Ads Management Ads Insights 本篇稍 ...
- Facebook广告API系列 1
Facebook广告API系列 1 前言 最近遇到大坑了,居然要去对接facebook的广告API,之前以为是跟鹅厂一样的API体系,看了半天Facebook的文档,冷汗直冒.... 这得一点一点的讲 ...
- Facebook广告API系列 Business Manager
Facebook广告API系列 Business Manager Business Manager,是个很牛叉的东西,有多牛叉呢? 因为facebook已经越来越商业化了,上面的每个账号,页面,往往都 ...
- facebook graph api 报错SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)')
使用facebook graph api,报错如下 一开始以为是https证书验证失败,查了一下午源码,没有看到问题,于是把Python27\lib\site-packages\requests\ad ...
- FaceBook登陆API -- Login with API calls
Login with API calls Related Topics Understanding sessions FBSession Error handling FBError FBLoginC ...
- facebook chat api 使用
官方API文档: https://developers.facebook.com/docs/chat/ 下面是根据文档修改的类: <?php class Invite_Chat{ protect ...
- facebook javascript api 使用
官方api文档:http://developers.facebook.com/docs 先简单的介绍下创建一个app(https://developers.facebook.com/apps),
- Facebook Graph API 接口请求
Graph API 调试器 这两天因项目需求,在调试FB的接口.项目的应用在FB上面.L特傻.没有区分FB的api的使用方式. 因为应用是在FB上面的.所以在登录应用的时候,就已经登录了FB平台.对于 ...
随机推荐
- c# 设置控件的前景颜色和背景颜色
AutoSize:设置为false取消自动计算尺寸功能,控件的大小则按照设定的Size来呈现,设置为true自动计算大小 TextAlign:设置对齐方式 // // 摘要: // 用默认的所有者运行 ...
- Linux上查看大文件的开头几行内容以及结尾几行的内容
head -n 50 filePath 查看开头50行的内容 tail -n 50 filePath 查看文件结尾50行的内容
- linux基础命令---显示进程ps
ps ps指令可以显示系统中当前进程的信息,它的输出结果是高度可定制的.如果您希望重复更新所选内容和显示的信息,请使用top(1)代替. 请注意,“ps-aux”与“ps aux”不同.POSIX和U ...
- Qt读取TXT文件时,GBK与UTF-8编码判断
读取txt文件时,很多时候无法获取文件的编码格式.如果直接进行使用,则有可能出现乱码.需要在使用前将其转为Unicode(Qt的默认编码格式). 虽然实际的编码格式种类非常多,但平常主要使用的有GBK ...
- 怎样从外网访问内网Nginx?
本地安装了一个Nginx,只能在局域网内访问,怎样从外网也能访问到本地的Nginx呢?本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Nginx 默认安装的Nginx端口是80. 实现步 ...
- Spring P命名空间 02
P命名空间 装配属性 使用<property> 元素为Bean 的属性装配值和引用并不太复杂.尽管如此,Spring 的命名空间p 提供了另一种Bean 属性的装配方式,该方式不需要配置如 ...
- Java中使用自定义类封装数组,添加类方法实现数据操作
1.具体见注释 2.后续或有更新 public class MyArray { private long[] array; private int cnt; // 自定义数组类的元素个数 /** 使用 ...
- org.springframework.jdbc.UncategorizedSQLException
org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException fo ...
- php实现共享内存进程通信函数之_shm
前面介绍了php实现共享内存的一个函数shmop,也应用到了项目中,不过shmop有局限性,那就是只支持字符串类型的:sem经过我的测试,是混合型,支持数组类型,可以直接存储,直接获取,少了多余的步骤 ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem D (Codeforces 831D) - 贪心 - 二分答案 - 动态规划
There are n people and k keys on a straight line. Every person wants to get to the office which is l ...