facebook_ads 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +18 -5
  4. data/facebook_ads.gemspec +2 -2
  5. data/lib/facebook_ads.rb +10 -1
  6. data/lib/facebook_ads/ad.rb +11 -0
  7. data/lib/facebook_ads/ad_account.rb +44 -2
  8. data/lib/facebook_ads/ad_campaign.rb +12 -3
  9. data/lib/facebook_ads/ad_creative.rb +17 -5
  10. data/lib/facebook_ads/ad_set.rb +2 -2
  11. data/lib/facebook_ads/ad_targeting.rb +16 -5
  12. data/spec/facebook_ads/ad_account_spec.rb +20 -0
  13. data/spec/facebook_ads/ad_campaign_spec.rb +42 -2
  14. data/spec/facebook_ads/ad_targeting_spec.rb +20 -0
  15. data/spec/facebook_ads/facebook_ads_spec.rb +16 -5
  16. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_campaigns/lists_campaigns.yml +3 -3
  17. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_creatives/lists_creatives.yml +3 -3
  18. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_images/lists_images.yml +3 -3
  19. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml +3 -3
  20. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ads/lists_ads.yml +3 -3
  21. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_all/lists_all_accounts.yml +3 -3
  22. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_campaign/creates_a_new_ad_campaign.yml +6 -6
  23. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_creative/creates_carousel_ad_creative.yml +7301 -0
  24. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_images/creates_an_image.yml +7 -7
  25. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_find_by/finds_a_specific_account.yml +3 -3
  26. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_reach_estimate/estimates_the_reach_of_a_targeting_spec.yml +3 -3
  27. data/spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml +114 -0
  28. data/spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/{creates_a_new_ad_campaign.yml → sets_effective_status_to_deleted.yml} +9 -9
  29. data/spec/support/facebook_ads.rb +1 -0
  30. data/spec/support/vcr.rb +3 -0
  31. metadata +8 -4
@@ -1393,11 +1393,11 @@ http_interactions:
1393
1393
  FAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAo
1394
1394
  FAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAo
1395
1395
  FAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoFAoP/Z
1396
- http_version:
1396
+ http_version:
1397
1397
  recorded_at: Wed, 26 Apr 2017 00:48:42 GMT
1398
1398
  - request:
1399
1399
  method: post
1400
- uri: https://graph.facebook.com/v2.8/act_10152335766987003/adimages
1400
+ uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adimages
1401
1401
  body:
1402
1402
  encoding: ASCII-8BIT
1403
1403
  string: !binary |-
@@ -2791,7 +2791,7 @@ http_interactions:
2791
2791
  X-Fb-Trace-Id:
2792
2792
  - HnqGGy599D0
2793
2793
  Facebook-Api-Version:
2794
- - v2.8
2794
+ - v<api_version>
2795
2795
  Expires:
2796
2796
  - Sat, 01 Jan 2000 00:00:00 GMT
2797
2797
  Vary:
@@ -2807,11 +2807,11 @@ http_interactions:
2807
2807
  body:
2808
2808
  encoding: UTF-8
2809
2809
  string: '{"images":{"13006112.jpg":{"hash":"d8fc613662fb5ef6cf5fb9d1fe779315","url":"https:\/\/scontent.xx.fbcdn.net\/t45.1600-4\/17508518_6076261586842_4063779518672797696_n.png"}}}'
2810
- http_version:
2810
+ http_version:
2811
2811
  recorded_at: Wed, 26 Apr 2017 00:48:43 GMT
2812
2812
  - request:
2813
2813
  method: get
2814
- uri: https://graph.facebook.com/v2.8/act_10152335766987003/adimages?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,hash,account_id,name,permalink_url,original_width,original_height&hashes%5B%5D=d8fc613662fb5ef6cf5fb9d1fe779315
2814
+ uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adimages?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,hash,account_id,name,permalink_url,original_width,original_height&hashes%5B%5D=d8fc613662fb5ef6cf5fb9d1fe779315
2815
2815
  body:
2816
2816
  encoding: US-ASCII
2817
2817
  string: ''
@@ -2844,7 +2844,7 @@ http_interactions:
2844
2844
  X-Fb-Trace-Id:
2845
2845
  - GaqHzzltfli
2846
2846
  Facebook-Api-Version:
2847
- - v2.8
2847
+ - v<api_version>
2848
2848
  Expires:
2849
2849
  - Sat, 01 Jan 2000 00:00:00 GMT
2850
2850
  Vary:
@@ -2860,6 +2860,6 @@ http_interactions:
2860
2860
  body:
2861
2861
  encoding: UTF-8
2862
2862
  string: '{"data":[{"id":"10152335766987003:d8fc613662fb5ef6cf5fb9d1fe779315","hash":"d8fc613662fb5ef6cf5fb9d1fe779315","account_id":"10152335766987003","name":"13006112.jpg","permalink_url":"https:\/\/www.facebook.com\/ads\/image\/?d=AQLp8EY4ZBMuyA2IRu5KoMMGwOwspA0KGY9SK9uTTnraQslGCrCuNBdqGZeyJCuonk6EdxwMdMunNLPPo--FC8MNqYS0wuSON5orNs7iSiai_FE2jCWIN6GjXn2PEWCCmZ5tdn6Z7JYhUoLq1PAN7fUg","original_width":570,"original_height":707}],"paging":{"cursors":{"before":"MTAxNTIzMzU3NjY5ODcwMDM6ZADhmYzYxMzY2MmZAiNWVmNmNmNWZAiOWQxZAmU3NzkzMTUZD","after":"MTAxNTIzMzU3NjY5ODcwMDM6ZADhmYzYxMzY2MmZAiNWVmNmNmNWZAiOWQxZAmU3NzkzMTUZD"}}}'
2863
- http_version:
2863
+ http_version:
2864
2864
  recorded_at: Wed, 26 Apr 2017 00:48:43 GMT
2865
2865
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/v2.8/me/adaccounts?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,account_status,age,created_time,currency,name
5
+ uri: https://graph.facebook.com/v<api_version>/me/adaccounts?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,account_status,age,created_time,currency,name
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -35,7 +35,7 @@ http_interactions:
35
35
  X-Fb-Trace-Id:
36
36
  - CuRn+gsmX/Q
37
37
  Facebook-Api-Version:
38
- - v2.8
38
+ - v<api_version>
39
39
  Expires:
40
40
  - Sat, 01 Jan 2000 00:00:00 GMT
41
41
  Vary:
@@ -53,6 +53,6 @@ http_interactions:
53
53
  string: '{"data":[{"id":"act_1223529531023664","account_id":"1223529531023664","account_status":1,"age":141.15273148148,"created_time":"2016-12-02T10:50:57-0800","currency":"USD","name":"International
54
54
  II"},{"id":"act_1198305280212756","account_id":"1198305280212756","account_status":1,"age":159.1747337963,"created_time":"2016-11-10T13:50:54-0800","currency":"USD","name":"Retargeting"},{"id":"act_1183122141731070","account_id":"1183122141731070","account_status":1,"age":179.92611111111,"created_time":"2016-10-27T10:55:59-0700","currency":"USD","name":"DollarStart"},{"id":"act_1132789356764349","account_id":"1132789356764349","account_status":1,"age":232.91157407407,"created_time":"2016-08-31T15:14:23-0700","currency":"USD","name":"LuxeJoy"},{"id":"act_1115226431853975","account_id":"1115226431853975","account_status":1,"age":256.05325231481,"created_time":"2016-08-10T17:27:49-0700","currency":"USD","name":"Ruby"},{"id":"act_953255011384452","account_id":"953255011384452","account_status":1,"age":546.76849537037,"created_time":"2015-10-26T09:23:16-0700","currency":"USD","name":"International"},{"id":"act_1051938118182807","account_id":"1051938118182807","account_status":1,"age":361.89405092593,"created_time":"2016-04-28T17:32:07-0700","currency":"USD","name":"Web"},{"id":"act_861827983860489","account_id":"861827983860489","account_status":1,"age":743.01085648148,"created_time":"2015-04-09T16:54:58-0700","currency":"USD","name":"Android"},{"id":"act_39788579","account_id":"39788579","account_status":1,"age":2973.0627199074,"created_time":"2009-03-05T15:04:59-0800","currency":"USD","name":"iOS"},{"id":"act_10152335766987003","account_id":"10152335766987003","account_status":1,"age":466.70608796296,"created_time":"2014-10-24T14:38:31-0700","currency":"USD","name":"Chris
55
55
  Estreich"}],"paging":{"cursors":{"before":"MjM4NDI1MjkxNDU2NTAyMTcZD","after":"NjAxODA5MTU2MDA0MgZDZD"}}}'
56
- http_version:
56
+ http_version:
57
57
  recorded_at: Wed, 26 Apr 2017 00:48:40 GMT
58
58
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/v2.8/act_10152335766987003/reachestimate?access_token=<access_token>&appsecret_proof=<appsecret_proof>&currency=USD&optimize_for=OFFSITE_CONVERSIONS&targeting_spec=%7B%22genders%22:%5B2%5D,%22age_min%22:18,%22age_max%22:20,%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D%7D
5
+ uri: https://graph.facebook.com/v2.9/act_10152335766987003/reachestimate?access_token=<access_token>&appsecret_proof=<appsecret_proof>&currency=USD&optimize_for=OFFSITE_CONVERSIONS&targeting_spec=%7B%22genders%22:%5B2%5D,%22age_min%22:18,%22age_max%22:20,%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D,%22income%22:%5B%5D%7D
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -35,7 +35,7 @@ http_interactions:
35
35
  X-Fb-Trace-Id:
36
36
  - CkopL2tG9bb
37
37
  Facebook-Api-Version:
38
- - v2.8
38
+ - v<api_version>
39
39
  Expires:
40
40
  - Sat, 01 Jan 2000 00:00:00 GMT
41
41
  Vary:
@@ -51,6 +51,6 @@ http_interactions:
51
51
  body:
52
52
  encoding: UTF-8
53
53
  string: '{"data":{"users":7800000,"bid_estimations":[{"unsupported":false,"location":3,"reach_min":0,"reach_max":0,"cpm_curve_data":"","cpc_curve_data":"","cpa_curve_data":"","dedup_winning_rate":0,"dedup_status":0,"pacing_status":0,"account_budget":150000,"estimate_DAU":0,"curve":[{"bid":0,"spend":0,"reach":0,"impressions":0,"actions":0},{"bid":1,"spend":274,"reach":665.35523611293,"impressions":827.9031969689,"actions":1.844446952004},{"bid":2,"spend":526,"reach":1163.1983230804,"impressions":1498.1938839748,"actions":3.3097915123364},{"bid":2,"spend":663,"reach":1449.9428012725,"impressions":1965.3471118416,"actions":3.8865028313425},{"bid":4,"spend":812,"reach":1723.4117950617,"impressions":2473.5614735407,"actions":4.4628495280986},{"bid":5,"spend":936,"reach":1900.1942347956,"impressions":2851.3396208895,"actions":4.8916792752631},{"bid":8,"spend":1125,"reach":2112.2675174642,"impressions":3141.0211175368,"actions":5.4835039900258},{"bid":10,"spend":1298,"reach":2305.049580969,"impressions":3367.1317720084,"actions":5.730963529418},{"bid":15,"spend":1934,"reach":3230.5069725617,"impressions":4310.4008024568,"actions":6.4202204250965},{"bid":22,"spend":3238,"reach":4999.4757279719,"impressions":6152.5432742153,"actions":7.1834806443477},{"bid":27,"spend":4299,"reach":6533.721313125,"impressions":7699.448129965,"actions":8.6054391349527},{"bid":40,"spend":7899,"reach":11871.078977638,"impressions":13548.856717159,"actions":11.27562137411},{"bid":47,"spend":9490,"reach":14582.158446565,"impressions":16569.386121142,"actions":13.314717583351},{"bid":57,"spend":11723,"reach":17587.530425269,"impressions":21303.883577031,"actions":15.766131666688},{"bid":84,"spend":14431,"reach":21432.209480504,"impressions":26061.214471774,"actions":19.406462787096},{"bid":101,"spend":16022,"reach":24525.142003591,"impressions":29660.727503464,"actions":21.54425609427},{"bid":122,"spend":17700,"reach":26828.58937358,"impressions":31967.399503751,"actions":23.799962200198},{"bid":147,"spend":19628,"reach":30175.23244102,"impressions":35314.042571191,"actions":26.392152620471},{"bid":177,"spend":21694,"reach":32092.16258664,"impressions":37230.972716811,"actions":29.168515834035},{"bid":213,"spend":23596,"reach":34888.910126101,"impressions":40027.720256271,"actions":31.725230576813},{"bid":256,"spend":24939,"reach":36131.724236534,"impressions":41270.534366704,"actions":33.531023721496},{"bid":308,"spend":26186,"reach":37283.80781754,"impressions":42422.61794771,"actions":35.205910114206},{"bid":370,"spend":27383,"reach":37905.607606266,"impressions":43044.417736436,"actions":36.814312335639},{"bid":444,"spend":28499,"reach":38405.557187601,"impressions":43544.367317772,"actions":38.313739084408},{"bid":533,"spend":29698,"reach":39546.688281769,"impressions":44685.49841194,"actions":39.656810833811},{"bid":640,"spend":31184,"reach":41472.249614977,"impressions":46611.059745148,"actions":41.373272371441},{"bid":922,"spend":35827,"reach":48391.963932271,"impressions":53530.774062441,"actions":45.075853954274},{"bid":1107,"spend":39709,"reach":53747.037689427,"impressions":58885.847819598,"actions":49.489685866067},{"bid":1329,"spend":45179,"reach":60060.430481269,"impressions":65753.059986957,"actions":54.267655742793},{"bid":1595,"spend":53180,"reach":69786.743584613,"impressions":77317.033425851,"actions":62.359947825847},{"bid":1913,"spend":65276,"reach":84784.720400015,"impressions":95873.895875409,"actions":66.960827621477},{"bid":2297,"spend":81863,"reach":103041.98891234,"impressions":120697.15260441,"actions":77.269757936654},{"bid":3309,"spend":136501,"reach":167574.26626847,"impressions":189994.57016726,"actions":90.860754621151},{"bid":3971,"spend":182286,"reach":222048.88406388,"impressions":254973.91945963,"actions":109.32189156425},{"bid":4766,"spend":246337,"reach":299776.66361403,"impressions":342712.47277228,"actions":138.64450516775},{"bid":5719,"spend":341398,"reach":386588.9015888,"impressions":461779.5253937,"actions":181.37754407679},{"bid":6864,"spend":478510,"reach":496931.95796472,"impressions":607707.7247427,"actions":231.49943408876},{"bid":8237,"spend":676355,"reach":619538.42237559,"impressions":751645.34682434,"actions":274.9990270277},{"bid":9885,"spend":960405,"reach":748467.48474108,"impressions":928066.97109742,"actions":325.35941461337},{"bid":11862,"spend":1369167,"reach":928642.86327858,"impressions":1170092.1075589,"actions":360.04107458364},{"bid":14235,"spend":1957798,"reach":1178959.5945031,"impressions":1516323.3647044,"actions":409.85606432875},{"bid":17082,"spend":2806068,"reach":1371791.0770766,"impressions":1935441.7757471,"actions":485.28413349418},{"bid":20499,"spend":4028534,"reach":1496482.3840336,"impressions":2129988.0253193,"actions":514.5642743302},{"bid":24599,"spend":5790336,"reach":1539483.8268748,"impressions":2236800.8704945,"actions":538.37829905621},{"bid":29519,"spend":8273482,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":554.45306018194},{"bid":35423,"spend":11576398,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":562.93342303933},{"bid":40000,"spend":14647415,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":562.93342303933}],"trace_id":"3bb7e83531ec9904bbb97953c7ab58b6","is_curve_eligible":false,"bid_amount_min":1172,"bid_amount_median":1495,"bid_amount_max":2014}],"estimate_ready":true}}'
54
- http_version:
54
+ http_version:
55
55
  recorded_at: Wed, 26 Apr 2017 01:15:27 GMT
56
56
  recorded_with: VCR 3.0.3
@@ -0,0 +1,114 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adsets
6
+ body:
7
+ encoding: UTF-8
8
+ string: campaign_id=120330000008134915&name=Test+Ad+Set&targeting=%7B%22genders%22%3A%5B2%5D%2C%22age_min%22%3A29%2C%22age_max%22%3A65%2C%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%7D%2C%22user_os%22%3A%5B%22Android%22%5D%2C%22user_device%22%3A%5B%22Android_Smartphone%22%2C%22Android_Tablet%22%5D%2C%22app_install_state%22%3A%22not_installed%22%2C%22income%22%3A%5B%5D%7D&promoted_object=%7B%7D&optimization_goal=IMPRESSIONS&billing_event=IMPRESSIONS&status=PAUSED&is_autobid=true&daily_budget=500&access_token=<access_token>&appsecret_proof=<appsecret_proof>
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.3.3p222
16
+ Content-Length:
17
+ - '830'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Host:
21
+ - graph.facebook.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Pragma:
30
+ - no-cache
31
+ Cache-Control:
32
+ - private, no-cache, no-store, must-revalidate
33
+ X-Fb-Rev:
34
+ - '3254203'
35
+ Content-Type:
36
+ - application/json
37
+ X-Fb-Trace-Id:
38
+ - AYQz85QnotA
39
+ Facebook-Api-Version:
40
+ - v<api_version>
41
+ Expires:
42
+ - Sat, 01 Jan 2000 00:00:00 GMT
43
+ Set-Cookie:
44
+ - sW=1503706308%3AAaAizVP7gS9ms0C4; path=/; domain=.graph.facebook.com; secure
45
+ Vary:
46
+ - Accept-Encoding
47
+ X-Fb-Debug:
48
+ - guowTMuCLalfZiCmanFr8qbxLZHnlOWobrgDhIKRUuWElOBhyuTUIA1N2nQmHqOt9Mrv3rtIazsqTt3Uz3vRCA==
49
+ Date:
50
+ - Sat, 26 Aug 2017 00:11:50 GMT
51
+ Connection:
52
+ - keep-alive
53
+ Content-Length:
54
+ - '27'
55
+ body:
56
+ encoding: UTF-8
57
+ string: '{"id":"120330000008135715"}'
58
+ http_version:
59
+ recorded_at: Sat, 26 Aug 2017 00:11:50 GMT
60
+ - request:
61
+ method: get
62
+ uri: https://graph.facebook.com/v<api_version>/120330000008135715?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,is_autobid,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,created_time,updated_time
63
+ body:
64
+ encoding: US-ASCII
65
+ string: ''
66
+ headers:
67
+ Accept:
68
+ - application/json
69
+ Accept-Encoding:
70
+ - identity
71
+ User-Agent:
72
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.3.3p222
73
+ Host:
74
+ - graph.facebook.com
75
+ response:
76
+ status:
77
+ code: 200
78
+ message: OK
79
+ headers:
80
+ Access-Control-Allow-Origin:
81
+ - "*"
82
+ Etag:
83
+ - '"6d9be8ff10bb989338e5889d3857393df2f0c885"'
84
+ Pragma:
85
+ - no-cache
86
+ Cache-Control:
87
+ - private, no-cache, no-store, must-revalidate
88
+ X-Fb-Rev:
89
+ - '3254203'
90
+ Content-Type:
91
+ - application/json
92
+ X-Fb-Trace-Id:
93
+ - HTjjzIpRtNY
94
+ Facebook-Api-Version:
95
+ - v<api_version>
96
+ Expires:
97
+ - Sat, 01 Jan 2000 00:00:00 GMT
98
+ Vary:
99
+ - Accept-Encoding
100
+ X-Fb-Debug:
101
+ - fRV1xoGs0FN6MCvd581V6YCJPyCT+n/oidjMnO9nTP6BslqnV2jGXn+hnoTH/1ie7FB2Ofgn+l92BqkDSK4sZw==
102
+ Date:
103
+ - Sat, 26 Aug 2017 00:11:50 GMT
104
+ Connection:
105
+ - keep-alive
106
+ Content-Length:
107
+ - '677'
108
+ body:
109
+ encoding: UTF-8
110
+ string: '{"id":"120330000008135715","account_id":"10152335766987003","campaign_id":"120330000008134915","name":"Test
111
+ Ad Set","status":"PAUSED","configured_status":"PAUSED","effective_status":"PAUSED","is_autobid":true,"billing_event":"IMPRESSIONS","optimization_goal":"IMPRESSIONS","pacing_type":["standard"],"daily_budget":"500","budget_remaining":"0","lifetime_budget":"0","targeting":{"age_max":65,"age_min":29,"app_install_state":"not_installed","genders":[2],"geo_locations":{"countries":["US"],"location_types":["home"]},"user_device":["Android_Smartphone","Android_Tablet"],"user_os":["Android"]},"created_time":"2017-08-25T17:11:47-0700","updated_time":"2017-08-25T17:11:47-0700"}'
112
+ http_version:
113
+ recorded_at: Sat, 26 Aug 2017 00:11:50 GMT
114
+ recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
5
+ uri: https://graph.facebook.com/v<api_version>/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -35,7 +35,7 @@ http_interactions:
35
35
  X-Fb-Trace-Id:
36
36
  - AhBg3GXvanL
37
37
  Facebook-Api-Version:
38
- - v2.8
38
+ - v<api_version>
39
39
  Expires:
40
40
  - Sat, 01 Jan 2000 00:00:00 GMT
41
41
  Vary:
@@ -51,11 +51,11 @@ http_interactions:
51
51
  body:
52
52
  encoding: UTF-8
53
53
  string: '{"id":"6076262142242","account_id":"10152335766987003","buying_type":"AUCTION","can_use_spend_cap":true,"configured_status":"DELETED","created_time":"2017-04-25T17:34:09-0700","effective_status":"DELETED","name":"Test","objective":"MOBILE_APP_INSTALLS","start_time":"1969-12-31T15:59:59-0800","updated_time":"2017-04-25T17:35:27-0700"}'
54
- http_version:
54
+ http_version:
55
55
  recorded_at: Wed, 26 Apr 2017 00:52:19 GMT
56
56
  - request:
57
57
  method: delete
58
- uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>
58
+ uri: https://graph.facebook.com/v<api_version>/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>
59
59
  body:
60
60
  encoding: US-ASCII
61
61
  string: ''
@@ -88,7 +88,7 @@ http_interactions:
88
88
  X-Fb-Trace-Id:
89
89
  - EC9oCOuSKpv
90
90
  Facebook-Api-Version:
91
- - v2.8
91
+ - v<api_version>
92
92
  Expires:
93
93
  - Sat, 01 Jan 2000 00:00:00 GMT
94
94
  Set-Cookie:
@@ -106,11 +106,11 @@ http_interactions:
106
106
  body:
107
107
  encoding: UTF-8
108
108
  string: '{"success":true}'
109
- http_version:
109
+ http_version:
110
110
  recorded_at: Wed, 26 Apr 2017 00:52:20 GMT
111
111
  - request:
112
112
  method: get
113
- uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
113
+ uri: https://graph.facebook.com/v<api_version>/6076262142242?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
114
114
  body:
115
115
  encoding: US-ASCII
116
116
  string: ''
@@ -143,7 +143,7 @@ http_interactions:
143
143
  X-Fb-Trace-Id:
144
144
  - GFItSlAIeCr
145
145
  Facebook-Api-Version:
146
- - v2.8
146
+ - v<api_version>
147
147
  Expires:
148
148
  - Sat, 01 Jan 2000 00:00:00 GMT
149
149
  Vary:
@@ -159,6 +159,6 @@ http_interactions:
159
159
  body:
160
160
  encoding: UTF-8
161
161
  string: '{"id":"6076262142242","account_id":"10152335766987003","buying_type":"AUCTION","can_use_spend_cap":true,"configured_status":"DELETED","created_time":"2017-04-25T17:34:09-0700","effective_status":"DELETED","name":"Test","objective":"MOBILE_APP_INSTALLS","start_time":"1969-12-31T15:59:59-0800","updated_time":"2017-04-25T17:35:27-0700"}'
162
- http_version:
162
+ http_version:
163
163
  recorded_at: Wed, 26 Apr 2017 00:52:20 GMT
164
164
  recorded_with: VCR 3.0.3
@@ -1,5 +1,6 @@
1
1
  FacebookAds.business_id = '760977220612233'
2
2
  FacebookAds.access_token = ENV['FACEBOOK_ACCESS_TOKEN'] || 'fake-facebook-access-token'
3
3
  FacebookAds.app_secret = ENV['FACEBOOK_APP_SECRET'] || 'fake-facebook-app-secret'
4
+ FacebookAds.api_version = '2.9'
4
5
  # FacebookAds.logger = Logger.new(STDOUT)
5
6
  # FacebookAds.logger.level = Logger::Severity::DEBUG
data/spec/support/vcr.rb CHANGED
@@ -16,4 +16,7 @@ VCR.configure do |c|
16
16
  c.filter_sensitive_data('<appsecret_proof>') do
17
17
  FacebookAds.appsecret_proof
18
18
  end
19
+ c.filter_sensitive_data('<api_version>') do
20
+ FacebookAds.api_version
21
+ end
19
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_ads
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Estreich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2017-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -105,10 +105,12 @@ files:
105
105
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_ads/lists_ads.yml
106
106
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_all/lists_all_accounts.yml
107
107
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_campaign/creates_a_new_ad_campaign.yml
108
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_creative/creates_carousel_ad_creative.yml
108
109
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_images/creates_an_image.yml
109
110
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_find_by/finds_a_specific_account.yml
110
111
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_reach_estimate/estimates_the_reach_of_a_targeting_spec.yml
111
- - spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/creates_a_new_ad_campaign.yml
112
+ - spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml
113
+ - spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/sets_effective_status_to_deleted.yml
112
114
  - spec/spec_helper.rb
113
115
  - spec/support/approvals.rb
114
116
  - spec/support/facebook_ads.rb
@@ -169,10 +171,12 @@ test_files:
169
171
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_ads/lists_ads.yml
170
172
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_all/lists_all_accounts.yml
171
173
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_campaign/creates_a_new_ad_campaign.yml
174
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_creative/creates_carousel_ad_creative.yml
172
175
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_images/creates_an_image.yml
173
176
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_find_by/finds_a_specific_account.yml
174
177
  - spec/fixtures/cassettes/FacebookAds_AdAccount/_reach_estimate/estimates_the_reach_of_a_targeting_spec.yml
175
- - spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/creates_a_new_ad_campaign.yml
178
+ - spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml
179
+ - spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/sets_effective_status_to_deleted.yml
176
180
  - spec/spec_helper.rb
177
181
  - spec/support/approvals.rb
178
182
  - spec/support/facebook_ads.rb