What is the correct syntax for a post url to Google Sheets which includes an API key? - google-sheets-api

I am trying to post data to a Google Sheet (via a Gravity Forms form submission in WordPress).
My post url looks like this:
https://sheets.googleapis.com/v4/spreadsheets/1S45-------w3u1A/values:batchUpdate&key=AI-------KxIiBcD8
But I get this response:
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
404. That’s an error.
The requested URL /v4/spreadsheets/1S45-----3u1A/values:batchUpdate&key=AI----KxIiBcD8 was not found on this server. That’s all we know.

Related

HTML page got returned as part of API response in karate. Now how to enter username and password on that?

I have an API which redirects to browser and on that we have to enter username and password.
The API returns the HTML page as part of the response. How from HTML response we can pick username and password via locator Id and click button?
I have tried below but as it is returned in the response I somehow need to tell where in response find that field and input.
And input('#username', 'username')
And input('#password', 'password')
When click('#kc-login')
What I would do is scrape any information needed out of the HTML like this: https://stackoverflow.com/a/61605535/143475
And then form an HTTP request to do what the clicking of the button actually does. Remember no matter what HTML and complex JS / UI you see, finally everything becomes some HTTP request. Use the developer tools "network" part of the browser to figure this out.
The rest is up to your creativity. Work with some web-developers if required.

How to verify and get response of all href="javascript:void(0)" through out website not only single page using selenium

a class="linkEffect" href="javascript:void(0)"
Note : I can get reference link by findelements property but somehow when I click on it than on redirect page I loss base as well I am not able get HTTP response like 200 - 404 - 500.
Please let me know if you have any perfect solution for it.
With below code I just get Main link which is not href="javascript:void(0)" also I get only for One Page i.e. which I mention URL. I want to find throughout website. Below is general code which is not working properly as per my requirement

Embed a URL in a simple http request

I'm making a simple http request that looks something like this:
https://example.com/api/chat.postMessage?text=This%20should%20be%20a%20link
What this does is posts a message to our internal chat service. The text= is the text that gets posted to the chat channel. What I'd like is to embed a hyperlink here so that when the message is posted, "This should be a link" will actually link to an http link. Is this at all possible? Thanks!
Looks like you're working with the Slack API? The following two links could be helpful:
the chat.postmessage method
testing the method call
To encode the following text...
"go to http://www.google.com/"
...it seems that you would send a request to the following URL:
.../api/chat.postMessage?text=go%20to%20http%3A%2F%2Fwww.google.com%2F

How do I display an image returned from MVC4 Web API

We have a Web API (MVC4) application that returns images from the database. I have verified that the call to the Web API does produce a valid image.
Here is the Fiddler result showing that the image is returned properly: :
I tried setting an image element with the same source as the call, but that didn't work:
<img id="img" src="http://localhost/Seek/api/artifactcontent/?userName=XXXXX&password=XXXXXX&id=15-00931-27" />
What am I doing wrong?
You request in Fiddler is a POST request; the <img> tag sends a GET request. If you want to display images using <img> tags, you'll need to make your action accept GET requests instead of (or in addition to) POST.

Changing the behavior of YouTube API generated links

My goal is to display YouTube search results in my website based on a keywords search (e.g through YouTube API or GoogleCustomSearch using youtube.com), but change it so when you click on the link - instead of redirecting you to the youtube video page, it will get the link's URL and transfer it to a PHP file as a variable.
You can read the result page with a CURL command, and use regular expressions to change the link urls to a link to your own link, wrapping the target url.
Something like this :
http://www.youtube.com/watch?v=XJ87Lsx40PI
turn it into :
http://yoursite.com/youtube.php?XJ87Lsx40PI