How do you only retrieve the "last" updated Adgroups from Facebook via the Ads API? I.e. only Adgroups updated after time t?
If this doesn't work, is there a way to only retrieve active ones?
The Ads API uses ETags, so you can extract the ETag HTTP header from the adgroup request, and use it the next time you retrieve your adgroups. If you place the code into a If-None-Match header, then the API will only send you the adgroups that have changed since the ETag was generated.
Related
I am using Laravel on my API server.
I am making an API request from my chrome extension.
Since I couldn't find a way to save my API auth token safely in the chrome extension and reuse it every time I want to make a request, hence I am looking for a way to identify the request on API side if the request is from my extension or not.
Add an extra header in the chrome extension where you are calling your Api .Add the header to api header when calling. Now in the controller use.
if ($request->hasHeader('X-Header-Name')) {
Api call from extension ..
}
Reference Link Request Header
Can someone please help me on finding a way to send an HTTP request to Google Drive to download a file with the access token included in the url?
I searched a lot in the internet and found only this way to send an access_token in URL:
"https://www.googleapis.com/drive/v3/files/[fileID]?access_token=ya29.a0AfH6SMA4FU********&key=[apiKey]"
As you know, it only returns the metadata of the file because it does not contain alt=media. If you add "alt=meida" to the url, it fails to load and returns nothing.
It can be easily fixed with passing the access_token as a header. However, I cannot do that because I am using the url as a "src" of HTML and as a source for video segments in .m3u8 file.
Any suggestion?
Since January 1st, 2020, the Google Drive API doesn't support the access_token query parameter anymore.
See https://cloud.google.com/blog/products/application-development/upcoming-changes-to-the-google-drive-api-and-google-picker-api for the announcement.
This change only applies to requests with ?alt=media by the way. Unfortunately that's precisely the kind of requests that you're using...
I'm afraid there's no solution in your case.
I'm trying to send a TrustPilot invitation using the Create Invitations API but no matter what I try, I get a response code of 415 and with no data returned, so it's virtually impossible for me to debug.
The URL I'm using is correct: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations (where {businessUnitId} is my business ID)
I am sending a valid (and current) oAuth token in my header.
I am sending a POST request.
I have tested my details with other "Business user OAuth Token" APIs and everything works, so my details are definitely correct. It's just this create invitation API that's not working.
I've tried everything. I've submitted minimal details, a full request, somewhere in between, the example request in the API, and so on. Always a response code of 415.
I've set my "Invitation Settings" in the TrustPilot Business portal, and have even tried submitting those details with the request (ie. sender e-mail "noreply.invitations#trustpilotmail.com" and a valid reply-to e-mail that's been configured).
I've tried contacting the "Integration Engineers" at TrustPilot who after a few back and forth e-mails, also have no idea, which is VERY unsettling. So time for Stack Overflow.
I need to get this figured out, so any help would be great! Perhaps someone can provide a sample request that works in their application that I can try to duplicate in mine?
Http status code 415 (Unsupported Media Type) is returned when Content-Type: application/json is not passed. You need to make sure that this header is added and that the content you are passing in the post body is valid json.
If you are already doing this then I would need an example of a request you are sending to help you further.
I am trying to get a shopify webhook to fill my customer class in parse.com, however something must go wrong. I don't know how to verify the parse response since Shopify sends this webhook out from it's ruby backend. I used requestbin to catch the webhook and I replicated a post request using postman to my parse url and everything works fine. Does anyone know how to debug requests like these? Is there a console in Parse where I can see all the incoming requests and the responses Parse.com sent back?
Try using Runscope for debugging webhooks. Full guide here: https://www.runscope.com/provider-guide/troubleshooting-webhooks - this is more than just a request bin. It's a full transparent proxy that will, like a bin, record the webhook notification, but will also pass it along to the intended destination (your webhook receiver) and record that response as well.
I followed the example on http://docs.brightcove.com/en/video-cloud/media/references/reference.html#Video. The response gets shown in an iframe. However, I would like to be able to get the JSON response in order to store the data (i.e., Brightcove video ID) in my own database. I tried using AJAX post but Brightcove doesn't seem to accept post requests from a different origin. Is there a way to simply get the response data without displaying it in an iframe or in a separate window?
You can't get the response data in javascript since the API response does not include CORS headers. You'd need to do this in server-side code, which also has the advantage of not exposing your API token to the browser.