Comments (10)
I don't think so. What are you trying to accomplish?
Also, do you know if there's anyway for us to catch error codes? The exception for a limited app or an invalid access token can only be caught as a string with a begin rescue.
from facebook-ruby-business-sdk.
from facebook-ruby-business-sdk.
The name of the image is assigned on upload. Use that name and the hashes that come back
from facebook-ruby-business-sdk.
Also, do you know if there's anyway for us to catch error codes? The exception for a limited app or an invalid access token can only be caught as a string with a begin rescue.
I don't.
from facebook-ruby-business-sdk.
One thing I did find is that we can get to the last API response:
...
results = ad_account.adimages.create(files_to_upload)
last_response = ad_account.last_api_response
puts last_response
returns something like this:
#<FacebookAds::APIResponse:0x0000XXXXXXX @status_code=200,
@headers={"access-control-allow-origin"=>"*", "pragma"=>"no-cache", "cache-control"=>"private, no-cache, no-store, must-revalidate", "facebook-api-version"=>"v3.0", "expires"=>"Sat, 01 Jan 2000 00:00:00 GMT", "x-fb-rev"=>"4114154", "content-type"=>"application/json; charset=UTF-8", "x-fb-trace-id"=>"XXXXXXX", "strict-transport-security"=>"max-age=15552000; preload", "vary"=>"Accept-Encoding", "x-fb-debug"=>"XXXXXXX", "date"=>"Wed, 18 Jul 2018 14:04:01 GMT", "connection"=>"close", "content-length"=>"425"},
@body="{\"images\":{\"elephant.png\":{\"hash\":\"XXXXX\",\"url\":\"https:\\/\\/scontent.xx.fbcdn.net\\/v\\/t45.1600-4\\/XXXXX\"},\"nodejs-logo.png\":{\"hash\":\"XXXXX\",\"url\":\"https:\\/\\/scontent.xx.fbcdn.net\\/v\\/t45.1600-4\\/XXXXX\"},\"MongoDB-Logo.png\":{\"hash\":\"XXXXXX\",\"url\":\"https:\\/\\/scontent.xx.fbcdn.net\\/v\\/t45.1600-4\\/XXXXXXXX\"}}}">
That would allow you to check for status codes, etc. I was able to grab both the name and hash from the response, so that resolved my immediate issue.
from facebook-ruby-business-sdk.
Could someone from Facebook weigh in here though? Are there plans to support read after write when creating ad images? Or is it already supported and I did something wrong in my code?
from facebook-ruby-business-sdk.
are you trying to get the name of the image from read-after-write? read-after-write is supported in /adimages it's just name of the images will be the key of the hash returned. and the sdk do not extract the key and put it in AdImage object currently
from facebook-ruby-business-sdk.
@alanho - Thanks for the response and that it what I'm doing. I did realize the name comes back in the response and so I'm using the last_api_response
property of the ad account to get at them (see my comment above - #50 (comment))
If this is the case, then what is the use of the fields
key when you create ad images? See the example image upload file - https://github.com/facebook/facebook-ruby-business-sdk/blob/master/examples/image_upload.rb
from facebook-ruby-business-sdk.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
from facebook-ruby-business-sdk.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
from facebook-ruby-business-sdk.
Related Issues (20)
- Ruby 3.1.0 errors with Psych::DisallowedClass: Tried to load unspecified class: Time HOT 2
- Can we upgrade safely? HOT 1
- When successful in creating a custom conversion, the response body is incorrect and generates a JSON::ParserError
- Not being able to retrieve preview code
- `ad_account.adrules_library.first.evaluation_spec` raises JSON::ParserError
- Update Faraday dependency to 2.x HOT 2
- Can't pull campaigns from Ad Accounts HOT 1
- File.exists? method was removed in ruby 3.2
- undefined method `configure' for FacebookAds:Module (NoMethodError) HOT 1
- Custom Properties Feature is not supported for Server-Side API in Ruby SDK HOT 1
- Support for app_data field HOT 5
- Specs are not passing
- Uninitialized constant FacebookAds (NameError)
- Cannot add user to custom audience on Ruby 3.2
- facebookbusiness README says that Ruby v2 is sufficient but the gemspec says otherwise HOT 1
- Breakdown fields are missing on AdsInsights
- `::UploadIO` is deprecated HOT 1
- JSON parsing fails in Rails 7.1 apps
- Graph API V12.0 Deprecation HOT 1
- Unsupported targeting option: targeting_automation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-ruby-business-sdk.