Where to put x api key while fetching from server - python-requests

I am trying hit following link Actual link from requests and python, since it is Javascript I dont want to use selenium for automation.
I know it uses api in backend, However I am not sure where to put key in url it has x-api-key for following url , I tried using ?x_api_key='key' in request header still not working
Api Link

Related

Slack API - Link to custom URI scheme

I have a (working) custom URI scheme that opens an app in my local machine. It looks somewhat like this:
customscheme://?ip=xx.xx.xx.xx?platform=xx
I am trying to send the user a message using the Slack API including a link that opens the custom URI. It seems to work with mailto: links but not with mine.. The syntax I am trying is the following:
<customscheme://?ip=xx.xx.xx.xx?platform=xx|Open Uri>
or
[Open Uri](customscheme://?ip=xx.xx.xx.xx?platform=xx)
without success.
The thing is, I am able to create the link from the UI using the Link (Ctrl+Shift+U) functionality, pasting the exact same link from above. The outcome is exactly what I want, the text with the custom URI as the link (and it opens it after a security check).
Is there some security concern that keeps me from getting this done?
I found that inserting some word before ? then will work well
customscheme://foo?ip=xx.xx.xx.xx?platform=xx

Why does XSLT throw a 503 error when the same URL works fine from a browser?

I have built a Rest API for a database on a web server, using PHP and MySQL. The URL is rewritten (using .htaccess) to be passed to my api.php code, which cuts up the URL parts and decides which data to return. As some fields for the query are optional, I have used an asterisk to have my api code skip that field and handle the next one.
This works fine when retrieving data in a browser and it also works when using AJAX calls. But when I use the exact same URL to retrieve data in an XSL transform, the server returns a 503 code. It seems that the asterisks I am using in my Rest API are causing the 503, but only when called from the XSL.
To make things even less understandable, pointing the XSL to a copy of the entire Rest API that runs on my localhost works fine with the asterisks.
I am trying to understand where the difference is. Does a web browser encode characters in a specific way before the request is sent to the server? Does a DNS server change the URL so that it never reaches my api code? Is the handling by the public web server correct and my localhost not? Unfortunately, I cannot check what happens to the URLs before they are passed to my api code, as it runs on a hosted domain, where I cannot open the access logs.

What will the RightSignature API send to my callback URL when a signer signs a document

When I send a one-off document to RightSignature via their API, I'm specifying a callback location in the XML document as specified in RightSignature's schema definition. I then get a signer-link value back from their API for the document. I display the HTML response from the signer-link URL in an iFrame on our website. When our user signs the document in this iFrame, which is rendering the responses from their website, I want their website to post to our callback location.
Can I do this with the RightSignature API and does it make sense?
So far, I'm only getting content in the iFrame that indicates that the signing was successful. The callback location does not seem to be getting called.
I got it solved just now. Basically, i was doing two things wrong first you have to go in RightSignature Account and set it there the CallBack url
Account > Settings > Advanced Settings
But the thing which RS is unable to mention to us that this url can not be of localhost, but it should be of https i mean like Live URL of your site like
https://stagingmysite.azurewebsites.net/User/CallBackFunction
And then in your CallBack just write these two lines and you will receive complete XML which would have the GUID and document status as well.
byte[] data = Request.BinaryRead(Request.TotalBytes);
string callBackXML = System.Text.Encoding.UTF8.GetString(data);
I found the answer with some help from the API team at RightSignature. I was using callback_location but what I really wanted is redirect_location. Their online documentation was difficult to follow and did not clearly point out the difference.
I got this working after a lot of trial and error.

Get referring domain from HTML5 Audio Tag Streaming URL

Part of a site I am working on at the moment requires Audio/Video previews.
These are server from a different server to the main site.
The Streaming URL is of the form:
www.myserver.com/Preview.aspx?e=I_AM_AN_ENCRYPTED_KEY
The Key is generated by the server that hosts the file, not the site on which the previews are actually displayed. It's kind of an API.
Part of the security to stop these previews being played anywhere except this website is supposed to check the domain which is requesting this, but it seems that HttpContext.Current.Request.UrlReferrer is NULL when requested from an HTML5 video/audio element.
Without posting the domain along with the Key to the API, is there any way that I can get the referring URL on the receiving server, server side?
EDIT:
To clarify:
There is a website with HTML5 elements which are directed to a URL on a different server, the URL and key is provided by this server (not the website)
When the API server receives a request to stream the preview it checks the Key (which basically tells it what to play) and also checks for the referring domain against a list of allowed domains.
Figured it out - in case anyone cares...
Simply replace:
ReferringDomain = HttpContext.Current.Request.UrlReferrer
with :
ReferringDomain = HttpContext.Current.Request.Headers("Referer")
Sorted! :)

How to make POST request using OAuth via Youtube API?

I am trying to get this thing to work for a couple days since it's my first time working with the OAuth system without any luck.
I have been experimenting here: https://developers.google.com/youtube/v3/docs/subscriptions/insert#try-it
With the following settings:
http://i.gyazo.com/5cd28f1194d5dfebee25d07bc0db965e.png
When I execute the code it successfully subscribes to the specified channelIdaccount with the authorized account.
I have tried to copy paste the shown POST URL into my browser without any luck. The plan was just to test it as I would like to implement this in PHP.
Now to my questions:
The {YOUR_API_KEY}, is this where I am supposed to type in the access token? If so, do I need the &mine=true tag at all?
I just realized that there are no ID's in the URL but there is an JSON-object in the request box example. Am I supposed to convert a string to JSON-object and pass it to the $fields= tag?

Resources