Helpful api instructions from the great mailgun api instructions say this:
GET /[domain]/bounces
Fetches the list of unsubscribes.
when I give it:
https://api:key-[my api key here] #api.mailgun.net/v2/[my domain here]/bounces
This works great but it only pulls down 100 as below
Parameter Description
limit Maximum number of records to return. (100 by default)
skip Number of records to skip. (0 by default)
sadly here is where the instructions dry up and as I am a newby to this, I haven't been here before, I can't figure out the url to add a limit of say 300 or even skip 100 so I can get the next batch.
can anyone tell me what this might look like in an HTTP statement as above
Thanks
The parameters can be sent using a POST request using multipart form data. I know this is not documented on that page, but that's what the curl example does, so it must work.
Related
So here is my case, I am trying to implement concurrency test using jMeter with over 100 users. I got the foundation set up. However, the challenge I am encountering is that I have two APIs on postman one which I need to get accident case as UIID that is the first API and the second API is an API in which I register the accident. Each accident api requires different accident case. In other words, all 100 users will have different accident case. I usually do that manually when manual test but how do I do that automated in jMeter
enter image description here
Thank you and best regards
You can use __UUID
"accidentCase": "${__UUID()}",
The UUID function returns a pseudo random type 4 Universally Unique IDentifier (UUID).
If you're getting an accident case in 1st request and need to use it in 2nd request you can extract it from the 1st request response using a suitable JMeter Post-Processor and save it into a JMeter Variable
Then in 2nd request you need to replace the 21d2a592-f883-45f7-a1c4-9f55413f01b9 with the JMeter Variable holding the UUID from the first request.
The process is known as correlation and there is a lot of information on it in the Internet.
In the app I'm working on, we have a process whereby a user can download a CSV or PDF version of their data. The generation works great, but I'm trying to get it to download the file and am running into all sorts of problems. We're using API Gateway for all the requests, and the generation happens inside a Lambda on a POST request. The GET endpoint takes in a file_name parameter and then constructs the path in S3 and then makes the request directly there. The problem I'm having is when I'm trying to transform the response. I get a 500 error and when I look at the logs, it says Execution failed due to configuration error: Unable to transform response. So, clearly that's where I've spent most of my time. I've tried at least 50 different iterations of templates and combinations with little success. The closest I've gotten is the following code, where the CSV downloads fine, but the PDF is not a valid PDF anymore:
CSV:
#set($contentDisposition = "attachment;filename=${method.request.querystring.file_name}")
$input.body
#set($context.responseOverride.header.Content-Disposition = $contentDisposition)
PDF:
#set($contentDisposition = "attachment;filename=${method.request.querystring.file_name}")
$util.base64Encode($input.body)
#set($context.responseOverride.header.Content-Disposition = $contentDisposition)
where contentHandling = CONVERT_TO_TEXT. My binaryMediaTypes just has application/pdf and that's it. My goal is to get this working without having to offload the problem into a Lambda so we don't have that overhead at the download step. Any ideas how to do this right?
Just as another comment, I've tried CONVERT_TO_BINARY and just leaving it as Passthrough. I've tried it with text/csv as another binary media type and I've tried different combinations of encoding and decoding base64 and stuff. I know the data is coming back right from S3, but the transformation is where it's breaking. I am happy to post more logs if need be. Also, I'm pretty sure this makes sense on StackOverflow, but if it would fit in another StackExchange site better, please let me know.
Resources I've looked at:
https://docs.aws.amazon.com/apigateway/latest/developerguide/request-response-data-mappings.html
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#util-template-reference
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings-workflow.html
https://docs.amazonaws.cn/en_us/apigateway/latest/developerguide/api-gateway-payload-encodings-configure-with-control-service-api.html.
(But they're all so confusing...)
EDIT: One Idea I've had is to do CONVERT_TO_BINARY and somehow base64 encode the CSVs in the transformation, but I can't figure out how to do it right. I keep feeling like I'm misunderstanding the order of things, specifically when the "CONVERT" part happens. If that makes any sense.
EDIT 2: So, I got rid of the $util.base64Encode in the PDF one and now I have a PDF that's empty. The actual file in S3 definitely has things in it, but for some reason CONVERT_TO_TEXT is not handling it right or I'm still not understading how this all works.
Had similar issues. One major thing is the Accept header. I was testing in chrome which sends Accept header as text/html,application/xhtml.... api-gateway ignores everything except the first one(text/html). It will then convert any response from S3 to base64 to try and conform to text/html.
At last after trying everything else I tried via Postman which defaults the Accept header to */*. Also set your content handling on the Integration response to Passthrough. And everything was working!
One other thing is to pass the Content-Type and Content-Length headers through(Add them in method response first and then in Integration response):
Content-Length integration.response.header.Content-Length
Content-Type integration.response.header.Content-Type
I have created a campaign, specified the interests in the ad and successfully executed the campaign which lasted 2 days. I have got around 9 website clicks and the reach was approximately 35000. I am trying to retrieve keyword stats through api but I am getting empty json object. I followed this link.
Here is the cURL command:
url -G -d "access_token=abcd" "https://graph.facebook.com/v2.7/ad_id/keywordstats"
And here is the result:
{"data":[]}
Why am I getting empty json object. Where am I going wrong? I need some assistance.
The keywordstats api only show the breakdown statistics for the ads that resulted in enough stats. In case some interests haven't resulted in any stats, they won't be included in the breakdown statistics .
As a rule of thumb, there is an average delay of 24 hours (before the stats are available). However, we've noticed that it can be less or more as well. Only Facebook will know the exact logic behind that.
It mostly works fine, but for some products it doesn't return an image at all even though there are some on Amazon website.
Here's an example of the product I'm having a problem with: http://amazon.it/dp/B004X4VOSQ
As you can see, it has 5 images, but I can retrieve none from their API.
I'm using the following request: http://webservices.amazon.it/onca/xml?AWSAccessKeyId=xxxxxxxxxxxxxxx&AssociateTag=xxxx&IdType=ASIN&ItemId=B004X4VOSQ&Operation=ItemLookup&ResponseGroup=Images%2CMedium&Service=AWSECommerceService&Timestamp=2016-01-12T11%3A40%3A12Z&Version=2011-08-01&Signature=xxxxxxxxxxxxxxxxxxxxxxx
And getting the following response (with the sensitive data removed): http://pastebin.com/fudLZZTB
There are no ImageSets or MediumImage groups or anything of the sorts. As I said, the problem only happens with some products. Others work just fine.
For example:
URL: http://www.amazon.it/dp/B000CRBEJ2
Request: http://webservices.amazon.it/onca/xml?AWSAccessKeyId=xxxxxxxxxxxxx&AssociateTag=xxxxx&IdType=ASIN&ItemId=B000CRBEJ2&Operation=ItemLookup&ResponseGroup=Images%2CMedium&Service=AWSECommerceService&Timestamp=2016-01-12T11%3A32%3A05Z&Version=2011-08-01&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Response: http://pastebin.com/jASjscQ4
It contains SmallImage, LargeImage, MediumImage and ImageSets groups, but request is pretty much identical to the previous one, except for ItemId and Signature. Any ideas why it happens? Am I making some kind of mistake while forming a request? Is it just a bug of Amazon? How can I make it to retrieve an image?
I just ran a query with the Scratchpad for this item you referenced:
http://www.amazon.it/dp/B004X4VOSQ
And I received the images in the XML response similar to the second example you gave.
Did you retry the request?
I think the title says it all. We have a site that uses a URL parts to specify locale, category, product, and product variation. For example:
/[country-code]/[category-slug]/[product-slug]/[variation-id]
As we support about 10 different locales, and some products have up to 30 variations, if we change a category, we can sometimes be trying to purge up to 1500 urls.
Is it possible using the Akamai CCU REST API to add a wildcard value, say for the country code, or variation id?
/*/[category-slug]/[product-slug]/*
I have seen some mentions of wildcards around but I'm not sure if they're supported by the API
This should be possible. When you go to CCU, click on "Refresh by Directory & File Extension". Hope this helps.
You can do a purge by CPCode.
I've just written a getting started guide for the CCU API:
https://community.akamai.com/community/developer/blog/2015/08/19/getting-started-with-the-v2-open-ccu-api?sr=stream
The only difference for your case is that you'll want to allow purge by CPCode, and set up a CPCode for the file areas you want to purge at once.