I have an application that currently retrieves a google spreadsheet in excel format and saves the xls file to the file system. It is using the ColdFusion google Api wrapper on riaforge, http://cfgoogle.riaforge.org/.
The wrapper is authenticating with a google account and then using cfhttp to download the file in binary format. The url to retrieve the document looks like the following.
https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=#urlEncodedFormat(arguments.id)#&fmcmd=#spreadSheetFormat(arguments.format)#
I would like to change the behavior of the app so that it downloads the document directly from a publicly shared document url, but if I use the public document url I end up with an xls file that tells me that my browser does not meet the minimum requirements, so I'm being served the web based view. If I use the same url format that the google docs api wrapper uses then I need to authenticate even though I pass the id of the public document.
I've searched the Google api docs, but I've been unable to find the proper url format to request the public document so that I can directly download the spreadsheet in binary format using cfhttp? What is the format that I need to download a public spreadsheet in xls format without authenticating using cffhttp?
Google is most likely reading the "user_agent" variable of the request. In CF this variable is something with coldfusion or java in it by default. Try adding the "useragent" attribute to the cfhttp request and use something common - like "Mozilla/5.0 (Windows NT 6.1; WOW64)".
I ended up having to authenticate using Ray's Google API cfc on riaforge. Once authenticated with my own account I could pass the id of a public spreadsheet to the download function of the google cfc and I'm able to download the spreadsheet as xls file. I was not able to find a way to download it without authenticating, but this method will keep the end users from having to authenticate with their account.
Related
I am trying to upload file to GCP cloud storage from browser but it support OAuth authentication.
Is there any way to store file without using OAuth and can only be use api key.
You can use the "signed URL" mechanism.
By using it, you can temporarily allow anyone who knows the URL to upload files to your cloud storage.
generate a special temporary URL (signed URL) in your backend
return that URL to the browser
upload a file to that URL by the javascript in the browser
references
https://cloud.google.com/storage/docs/access-control/signed-urls
https://cloud.google.com/storage/docs/access-control/signing-urls-with-helpers#storage-signed-url-object-nodejs
I would like to be able to receive a public Notion page URL and return the ID of that page. I don't know if that is possible using the API.
I've tried taking the end of this URL and using it to retrieve the page in postman
https://www.notion.so/asnunes/Simple-Page-Text-4d64bbc0634d4758befa85c5a3a6c22f
https://api.notion.com/v1/pages/4d64bbc0634d4758befa85c5a3a6c22f
But it didn't work :/
The ID of the page is that alphanumeric string at the end of the URL before the query parameters. This would be what you would use when retrieving information from the page using the GET Page or GET block endpoints in the API.
If you do not have access to the page (i.e. your integration does not have access to the page in your workspace) you will not be able to use the API to make a request to it. You cannot use integrations to request information from other workspaces. Your integration is not authorized to access other workspaces.
I am using s3-bucket to store app config data for multi tenant application. I need tenant info saved in public file(.json) in s3-bucket before client is logged in to the application. For example, app config data might be client logo and some custom title/sub-title for each tenant and etc. I am trying to fetch file content based on sub-domain.
So, I need to fetch the client data, while rendering the login component itself. I am using aws-sdk tool in client side, but am facing 'missing credentials` error.
I am not getting, How to achieve this??
thanks and regards
SHASHIDHAR N K
The AWS SDK for Javascript uses the S3 rest API in such a way that it requires a GET request to be authorized. This is because it uses request parameters to override response header values and for these the rest API documentation for GET says:
Note - You must sign the request, either using an Authorization header or a pre-signed URL, when using these parameters. They cannot be used with an unsigned (anonymous) request.
However, you don't need to use S3 to get a public file, you can make a standard http request using XMLHttpRequest or suchlike.
My client software needs to call a service online (preferably in Azure) that generates a document that is then retrievable from an URL. I believe it would go something like this:
Client calls service with parameters.
Service generates document and stores it in CDN.
Url pointing to CDN is delivered to client.
Client downloads the document via the URL. (Preferably a restricted number of times.)
What is the easiest/best way to accomplish this?
I'd use BLOBs in Azure storage. You can add the CDN option to Azure storage. Each blob has a unique URL that can be public or private. You could track reads in your system and then make the URL private.
What set of Windows API calls will allow downloading a web resource (specifically an XML document) when the site is protected using Digest authentication without having to enter a username and password?
I can use MSXML's “open” function on the IXMLHTTPRequest interface, but it requires a username and password to be supplied even though I'm logged on to the Windows domain server.
Internet Explorer can accomplish this task without requiring me to enter this information.
I'm not familiar with this particular API. But it looks like there is a function to set a request header called setRequestHeader so have you tried adding the following line directly to the request header?
Authorization: Basic %s\r\n
Note: %s is name:password in base64 encoding.