Trello API | Move card to a new list - api

I'm trying to move a card from one list to another however, I keep getting this error:
23:32:04.273 - PUT https://api.trello.com/1/cards/CardId/idList?key=Key&token=Token: Trust check failed, The operation completed successfully.
I'm using this from a virtual game server via "HttpService", these are the arguments for a POST requeset(screen capture link): http://gyazo.com/d9c24682c73973473720119c7a5939f8
A request would look something like this: game:GetService("HtttpService"):PostAsync("url", data, HttpContentType (can be left empty))
My question is, Is the Syntax correct for the PUT request, and if so, any idea why I'm getting a "trust check failed" ?

The reason the trust check fails: ROBLOX disabled it for normal scripts because it creates a huge security threat to many sites including ROBLOX itself. They only allow their own scripts to run this because of this reason.
Short fix (not easy):
If you have a website, send a get request to a php page that sends put to trello.

Related

Localhost API for TD Ameritrade

I was creating an API for TD Ameritrade (my first time creating or dealing with APIs) and I needed to put in my own call back URL. I know that callback URL is where the API sends information to and i heard that I can just use my localhost API. I scoured the internet and I dont know how that would work and I was wondering if i can just use http://localhost?
Sorry if I seem like a noob because I am
In short, yes.
Follow the excellent directions at
https://www.reddit.com/r/algotrading/comments/c81vzq/td_ameritrade_api_access_2019_guide/. (Even with them, I spent excessive time on trial and error!)
Since stackoverflow has a limit of 8 links in a response, and the localhost text string looks like a link, I’m showing it with the colon replaced by a semicolon, i.e., http;//localhost to reduce the link count. Sorry.
I used the Chrome browser after first trying Brave, which did not work for, possibly because of my option selections.
Go to https://developer.tdameritrade.com/user/me/apps
Add a new app using http;//localhost (delete existing app if there is one).
Copy the resulting consumer key text string (AKA client_id or OAuth User ID).
Go to https://developer.tdameritrade.com/content/simple-auth-local-apps, follow instructions. Note: leading/trailing blanks were inserted by MSWord due to copy/paste of the auth code, which had to be manually deleted after wasting excessive time identifying the problem. The address string looks like:
https://auth.tdameritrade.com/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost&client_id=ConsumerKeyTextString%40AMER.OAUTHAP
This returns a page stating the server refused to connect, but the address bar now contains a VeryLongStringOfCharacters in the address bar:
https;//localhost/?code= VeryLongStringOfCharacters
Copy the contents of the address bar, go to https://www.urldecoder.org/, decode the above, and extract the text after “code=”. This is your refresh_token
Go to: https://developer.tdameritrade.com/authentication/apis/post/token-0, fill out the fields with
grant_type=authorization_code
refresh_token=<<blank>>
access_type=offline
code=RefreshTokenTextString
client_id=ConsumerKeyTextString#AMER.OAUTHAP
redirect_uri=http://localhost
Press SEND.
If the resulting page starts with HTTP/1.1 200 OK, you have succeeded.
Try updating your redirect to:
redirect_uri=https://localhost
They may require https now and you need a colon instead of a semicolon. Everything looks correct. This process generally takes me more then one attempt, and 15 minutes to an hour to get my refresh token squared away every 90 days.
dont use #AMER.OAUTHAP in client_id
If you generate a new code and based on that try to get a new access token. it should work.

Trying to create a GET request to pubgtracker

I am trying to practice my developing and wanna build my own desktop application using: https://pubgtracker.com/site-api
Before I even start the project I want to make sure that I manage to receive information from the PUBG api. Therefore I opened https://www.hurl.it/
and I try to enter the following:
GET request, and in the destination https://api.pubgtracker.com/v2/profile/pc/{pubg-nickname} (for example lucifini1 currently ranked #1)
In addition they request the API key as a header so I did the following:
+ ADD HEADER,
In the name field added TRN-Api-Key
and in the value I added my key.
When I launch request i get an: internal server error.
How can I debug it and know what I am missing?
Am I doing it correctly?
Thanks

Accessing Metacritic API and/or Scraping

Does anybody know where documentation for the Metacritic api is/if it still works. There used to be a Metacritic API at https://market.mashape.com/byroredux/metacritic-v2#get-user-details which disappeared today.
Otherwise I'm trying to scrape the site myself but keeping getting a blocked by a 429 Slow down. I got data like 3 times this hour and haven't been able to get anymore in the last 20 minutes which is making testing difficult and application possibly useless. Please let me know if there's anything else I can be doing to scape I don't know about.
I was using that API as well for an app I wrote a while ago. Looks like the creator removed it from Mashape. I just sent him an email to ask whether it'll be back up. I did find this scraper online. It only has a few endpoints but following the examples given you could easily add more. Let me know if you make any progress!
Edit: Looks like CBS requested it to be taken down. The ToS prohibits scraping:
[…] you agree not to do the following, or assist others to do the following:
Engage in unauthorized spidering, “scraping,” data mining or harvesting of Content, or use any other unauthorized automated means to gather data from or about the Services;
Though I was hoping for a Javascript way of doing this, the creator of the API also told me some info.
He says I was getting blocked for not having a User agent in the header and should use a 429 handling procedure i.e. re-request with longer pauses in between.
A PHP plugin available as well: http://datalinx.io/shop/metacritic-api/
I had to add a user agent like JCDJulian said and now it allows me to scrape. So for Ruby:
agent = Mechanize.new
agent.user_agent_alias = "Mac Firefox"
Then it stopped giving me the 403 Forbidden error.

How to propagate data from mod-auth-external authenticator to served page

Background
In our Apache configuration we use mod-auth-external (previously on Google Code) to invoke PAM authentication.
Now there is a request for proper handling of shadow-based password expiration:
If password is before warning period Apache should respond with HTTP status code 200. Nothing new here.
If password is in warning period (its validity end is near) Apache should respond with HTTP status code 200, but include somehow information about the warning period.
If password is in expiration period (it is no longer valid but user can still change it on his own) Apache should respond with HTTP status code 401 and include somehow information about expiration period.
If password is beyond expiration period (it is no longer valid and account was locked, administrator must unlock it) Apache should respond with HTTP status code 401 and include somehow information about the locked state.
(There are also corner cases of page missing or some other errors. It is not clear what to do then. But it seems that solving above points would allow to solve those corner cases as well.)
Our PAM authenticator (used through mod-auth-external) is able to differentiate those cases by adjusting return values. That we already have.
The problem is however how to get information from the authenticator to the associated action serving the page (either actual page with 200 status code or 401 error document).
Current investigations
It should be noted that there is significant difference between requirement 2 and requirements 3 and 4.
Requirements 3 and 4 alone are somewhat easier because they both involve our mod-auth-external authenticator returning error (access denied). So we only need to know how to get that error code in 401 error page. I even raised issue on that on mod-auth-external page.
Requirement 2 is much more difficult. In that case our authenticator must return 0 (access granted) and still somehow propagate information about the warning to whatever gets served in the end.
Logs parsing
Obvious (and ugly) idea is to parse logs. mod-auth-external description on Google Code Wiki mentions that authenticator return value gets written to Apache syslog. Also whatever authenticator prints to standard error stream gets logged as well.
This could be used to pass information from authenticator to some other entities.
The difficulty here is that it is not clear how to do it safely. What to print to be sure that "the other entity" will match properly current request with log entry. Mere URL doesn't seem to be enough since there can be multiple requests for the same URL at the same time. While I don't see anything more useful in what authenticator gets.
Another issue here is that it seems that to be able to parse the logs you have to have some non-trivial code running for "the other entity". And this complicates things further since how should we do it?
Another idea
If we could make the authenticator somehow modify "request session" (or whatever, maybe just environment? - I don't know, I'm new to Apache) to add arbitrary data to it we would be (almost) at home.
Our authenticator would somehow store "password status" and also possibly days remaining to the end of warning/expiration period (if applicable). Then upon serving 401 error page we would retrieve that back and use it to dynamically generate content of the page.
Or even better we would have it stored in session so that the other end could read that data directly. (For cases where it is not simply a browser showing page.)
But so far I fail to see how to do that.
Do you have any idea how to meet those requirements?
For over a month I got no answer here. Nor on GitHub issue that I opened for mod-auth-external.
So I ended doing a custom modification to our mod-auth-external. I don't like modifying third party software but this one seems dead anyway. And also it turned out we are using pretty old version (2.2.9 which I upgraded to 2.2.11, the last in 2.2.x line). Which already had some customizations anyway.
I explained details of the solution in a comment to my GitHub issue so I will not repeat them here.
I will however comment on shadow details as they were not mentioned there.
I had two choices: either use getspnam function to retrieve shadow data or to parse messages generated by PAM. First attempts based on getspnam function but in the end I used PAM messages. I didn't have strong reasons for any of those. However I decided to propagate in HTTP response not only shadow status but any PAM message that was generated and so it seemed easier to follow that way.

PayPal - 10001 internal error: timeout processing request Express Checkout

I have a problem with the Express Checkout. I tried all the solution provided in the web but I cannot make it work!
I'm using VB 2012 for Web and ASP.NET. I built a cart in the web site and try to integrate PayPal Express Checkout (for now using the test account in Sandbox).
When I click on the PayPal button it shows me the error:
10001 Internal Error: Timeout processing request
Debugging the application I found that the problem is when he try to make the call:
Try
Using myWriter As New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(strPost)
End Using
Catch e As Exception
End Try
Where strPost is the following:
METHOD=SetExpressCheckout&RETURNURL=http%3a%2f%2flocalhost%3a63223%2fCheckout%2fCheckoutReview.aspx&CANCELURL=http%3a%2f%2flocalhost%3a63223%2fCheckout%2fCheckoutCancel.aspx&BRANDNAME=PayPal+Sample+Application&PAYMENTREQUEST_0_AMT=36&PAYMENTREQUEST_0_ITEMAMT=36&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_CURRENCYCODE=USD&L_PAYMENTREQUEST_0+_NAME=Modena&L_PAYMENTREQUEST_0_AMT=36&L_PAYMENTREQUEST_0_QTY=1&USER=minni_1356740302_biz_api1.gmail.com&PWD=1356740320&SIGNATURE=AlYEmGf5ECuFHhwJgGlXJ.tMCTY0AFMcAx3nUjv6Ssg4RlD7YYwyoOJb&VERSION=88.0&BUTTONSOURCE=PP-ECWizard
What could be wrong?
I really need help..​Any and all help is appreciated.
Thanks in advance!
This error could simply mean there's an issue with the PayPal sandbox servers, or it could mean you have a problem with your request. I was able to successfully hit the sandbox with SetExpressCheckout just now, though, so I'm guessing it must have something to do with your request.
One thing I see right away is that you won't be able to use localhost in your ReturnURL and CancelURL because at the time that gets used it will be running from PayPal's server. As such, "localhost" will be their server, not yours, and the redirect won't work. You'll need to use your own public IP address or setup a domain of some sort to point to your test server. That could be what their server isn't liking.
Another thing I notice is that you're just using the value 36 for your amounts. PayPal documentation specifies you need to use two decimal places on amount values, so you need to make sure and pass 36.00 instead.
The next thing I notice, which is probably what's causing your problem, is that one of your parameter names is invalid: [L_PAYMENTREQUEST_0+_NAME]
You need to get that + out of there. I bet that'll fix your issue, but I'd still get those other things fixed up, too.