Do Amazon searches with CURL (or any programmatic way)? - web

I'm trying to get Amazon search results programatically.
For instance, if you go to amazon.com and type computer, the resulting URL is https://www.amazon.com/s?k=computer&ref=nb_sb_noss_2, but running
curl https://www.amazon.com/s?k=computer&ref=nb_sb_noss_2
gives back an error page.
Is there a way to use curl, or any programmatic way (except the API) to fetch Amazon search results?

Amazon does provide API access to developers. The top of the output from the curl command you posted reads as follows:
To discuss automated access to Amazon data please contact
api-services-support#amazon.com. For information about migrating
to our APIs refer to our Marketplace APIs at
https://developer.amazonservices.com/ref=rm_5_sv, or our Product
Advertising API at
https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html/ref=rm_5_ac
for advertising use cases.

Related

Accessing Amazon MWS inBound shipments

I want to access MWS Inbound Shipments API form C# in a similar way I do with the Amazon Reports using MarketplaceWebService
But I don't know how to to it.
For example how can I do this call form c# : https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentItems.html?
The easiest and quickest approach is to download the C# SDK for MWS, where you can create a client and call the ListInboundShipmentItems method directly. For this particular operation, ShipmentId is required. All you need to do is add your AWS keys and token (if applicable) and make the call. I noticed that the SDK used to be publicly available, but I think now you are required to log in with a seller account.
If you are not using the SDK, your request should look like this:
http://mws.amazonaws.com/FulfillmentInboundShipment/2010-10-01/
?Action=ListInboundShipmentItems
&Version=2010-10-01
&AWSAccessKeyId=1QZHP81EXAMPLEN5R44N
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&SignatureVersion=2
&SignatureMethod=HmacSHA256
&Signature=VY6sqvdk01VeEXAMPLEG0Vh4oj3
&Timestamp=2015-12-01T02:40:36Z
&SellerId=1234567890
&ShipmentId=SSF85DGIZZ3OF1
Make sure you read the developer guide too.

Get content of page type in Kentico10 via Rest service

I am trying to retrieve data of page type via rest service in Kentico 10.
What should be format of base URL for sending Post request and for checking content on browser?
If you want to retrieve content you have to use GET (not POST). POST is for creating resources, PUT is for updating.
From the documentation:
The base URL of the Kentico REST service is /rest.
For example, if your site is running at http://localhost/Kentico, use
http://localhost/Kentico/rest as the base URL of the service.
This is how you retrieve all documents with all their coupled data:
http://localhost/Kentico/rest/content/currentsite/en-us/all/?coupleddata=true
Again, see the documentation for all the examples.
Try something like this:
/content/currentsite/<culture>/all/?classnames=<class code name>
Here you can find all the details on getting content/data via Kentico rest service.

How to get the location of an Amazon Echo from an Alexa Skill

I know that Amazon does not directly provide developers with a way to get the location of the user's echo, but I was wondering if there was a way around this. I'm writing the skills in node, so I have run into node packages like geoip, but when I upload the skill to aws lambda, I get an error that says something along the lines of the ELF headers are not correct. Any assistance would be much appreciated!
You can now get the address of the device, as specified in the customer’s device settings.
This is new as of 2017-04-05. See Amazon's blog post about their new Device Address API.
I'm not sure exactly what you are after, but this new API can give two different levels of address (Country and postal code only, or full address). To get their location you would need to use another API to translate the address into location coordinates. This is called a Geocoding API and Google Maps API includes this capability (for example).

DocuSign Integration Into FileMaker

The basic work-flow I am trying to implement is to generate a PDF from FileMaker data, upload it to DocuSign for signing, and download the signed document back to FileMaker.
The DocuSign API requires custom headers, so I cannot use the built-in FileMaker 13 Insert From URL script step. Instead, I am using the BaseElements plug-in BE_HTTP_Set_Custom_Header and BE_GetURL functions. I currently have the DocuSign Login API call working.
Now I am trying to use the DocuSign API to upload a document and request a signature. This requires a multi-part/form-data POST request. Unfortunately, neither the BaseElements nor Troi URL plug-ins support multipart/form-data. In fact, I cannot find any plug-in that does. Is anyone aware of a FileMaker plug-in that supports multipart/form-data POST?
https://www.docusign.com/developer-center/quick-start/request-signatures
According to a comment on the Goya support forum last week, the next version of the BaseElements plug-in should support pass-through to the curl command line utility. If true, then as an alternative it seems possible to write a curl command to build the proper request, but my HTTP and curl knowledge is limited. So far, I have been unable to get the DocuSign signature request example working in Terminal. Has anyone been able to upload a document and request a signature with a single curl command?
http://support.goya.com.au/discussions/free-baseelements-plugin/1088-be-plugin-and-http-file-upload
Finally, I would be grateful for any other ideas or suggestions for attacking this problem.
Thank you!
Yoo could use ScriptMaster and Groovy to write your own function to support the multipart/form-data type
It took me a whole week but I managed to get it working on FileMaker 14.
It took me a whole week but I did manage to integrate it completely. I studied with my CEO the various providers out there and we ended up choosing DocuSign because our clients would be able to sign/approve our Estimates from literally any device (and also providing us with some more information if we need) such as Credit Card and etc), and because the annual costs were very competitive.
On the Development side it was hard, but not impossible.
The steps to master it are as follows:
1 - Study REST, and HTTP requests fundamentals (two youtube videos will do the trick).
2 - Get familiar with the command Curl in order to make POST and GET requests from Terminal (on Mac). Once you get to this point. Then you can try to follow Docusign's steps to POST and GET from Mac Terminal (not through FileMaker as yet). The first command that worked for me is as follows:
curl -i -H "Accept: application/json" -H 'X-DocuSign-Authentication:{"Username": "myemail#hotmail.com","Password": "mypassword", "IntegratorKey": "fae5e715-dec2-477f-906e-b6300bc9d09a"}' -X GET https://demo.docusign.net/restapi/v2/accounts/8aabdb38-41ab-4fab-bae9-63a071394a7a
If you replace the text above in bold with your DocuSign Developer credentials/information you should get a HTTP Header 200 OK - which means that you are in the right way.
This is important because you need to understand what information should be in the Headers, allowing Docusign to accept your requests.
3 - Translate the same concept into FileMaker. This is the most tricky part. First you need to create two Custom Variables. One will be your Docusign authentication (email, password and Integration Key). Something like this:
enter image description here
and the other one will be your endPoint , which is simply your Docusign url followed by your account number.
enter image description here
4 - Now you need to install BaseElements plugin onto your FileMaker Database(you wouldn't need this if you were using FileMaker 16). This will allow you to send POST, GET, DELETE, and UPDATE requests to Docusign. Unfortunately BaseElements's documentation is not super so I struggled a little bit till a get an actual result, but I will try to break it down for you here.
In order to make a GET request similar to the example that we have made we need to make a one line Script which looks like:
enter image description here
and then, inside the Refresh Object function:
enter image description here
This Script was adapted from a BaseElements plugin used to do Vimeo HTTP GET Requests - please see the link for more details on how to use it and test it: FileMaker REST using BaseElements Plugin - ISO FileMaker Magazine .
I think this gives you pretty much a good idea of how it works.
Unfortunately Docusign still doesn't provide any documentation or support to FileMaker developers, and this is as far as the internet goes. So if you need to make POST requests, it will get a bit more complex since you will have to put your FileMaker fields in JSON format, BaseElements POST syntax changing the script from GET to POST accordingly and POST inserting one more command with your data:
// insert this on your FileMaker POST script after the Headers List end
~data = BE_HTTP_POST ( ~endpoint ; "{
\"documents\": [
{ all of your JSON code adapted to FileMaker }]}");
You will also have to turn the PDF files that you want to send into Base64 format.
If you do this trick you will be good to go.

Google apps script in HTML

Is it possible to use google apps script in my HTML? I want to be able to write to a spreadsheet from a form in purely Javascript from an external framework such as Node.js.
https://developers.google.com/apps-script/
Google Apps Script's syntax is Javascript, however it is a unique server-side framework that does not behave as a library to applications outside of the Apps Script servers. (No, you won't be able to use Google Apps Script in your node.js app.)
However, that doesn't mean that your node.js app (or any other app on the web) can't interact with your spreadsheet. For instance, your app could authenticate as you using the OAuth API, then access the spreadsheet through the Google Drive API. For an example of this, see Accessing Google Spreadsheets from Node.js
Alternatively, you could roll your own spreadsheet API in Google Apps Script, to support read / write of your sheet via HTTP requests from your node.js app. There are plenty of examples of that, for example Insert new rows into Google Spreadsheet via cURL/PHP - HOW?.
Sure you can. You can use HtmlService to create your web form, then send the submission data to your Spreadsheet with server functions.
Nowadays you could use the Google Apps Script API to call your Google Apps Script code from other platforms like Node.js, actually the official docs include a quickstart for Node.js.
You can you use HtmlService, but maybe can be helpfull to read the Google Hosted Libraries https://developers.google.com/speed/libraries/
To use a Javascrtip library inside GAS, I recommend JQuery.
But Maybe, you can use Node.js inside your external website and make a AJAX Request (get or post) to a GAS and return from GAS this:
ContentService.createTextOutput(e.parameter.callback + "("+Utilities.jsonStringify(JSONDATA)+")").setMimeType(ContentService.MimeType.JSON);
After that, process it inside your AJAX request...
Mogsad is right that you might be better of with Google Drive API to interact with your Spreadsheet!
...But depending on your exact need you might have some possible interaction between external service and google apps scrip using Content service Google Dev link.
Content Service can send back several information upon GET request (ATOM, CSV, ICAL, JAVASCRIPT, JSON, RSS, TEXT, VCARD, XML). By playing around with url parameters you can get information out and in a spreadsheet, send an email, trigger some action etc!.
But that is far from a real external library and direct interaction with server side functions!

Resources