Fusion table API, INSERT query, bad request - sql

I have a fusion table with fields: username, description,latitude,longitud,geolocation. I am trying to create a new row with information via the google API. I triple checked that the fusion table is open, the tableid and the apikey are correct, and I have the fusiontable API enabled with 0% of the quota. I think the wrong request must be because some coma or quotation mark but to be honest it completely escapes me. I have tried different combinations and cannot find the mistake. Below error that I get, the code that use in php to generate the link and the link itself. Any idea would be greatly appreciated.
Thank you
link returns:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
Php Code:
$apikey = "AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA";
$tableid = "1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03";
$username="webuser";
$description="nujkn";
$latitude="78";
$longitud="110";
$geolocation="98.8789, 150.1111";
$link = "https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+".$tableid."+(username,description,latitude,longitud,geolocation)+VALUES+('".$username."','".$description."','".$latitude."','".$longitud."','".$geolocation."')&key={".$apikey."}";
Link generated: https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+('webuser','nujkn','78','110','98.8789')&key={AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}
which in browser looks like: https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+(%27webuser%27,%27nujkn%27,%2778%27,%27110%27,%2798.8789%27)&key={AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}

Related

Strapi API register returning a 400 error

I’ve been creating a web app with a login and a registration function and so far everything has been going great. I managed to connect the app to the api/auth/local api endpoint and send some nice post requests.
Now, I’ve been trying to send requests to the http://localhost:1337/api/auth/local/register endpoint and without any success. I’ve been doing this according to:
https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#registration
I keep getting a 400 error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "An error occurred during account creation",
"details": {
}
}
}
If I try to send a request with an email that’s already registered in strapi, the response will give me the correct error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "Email is already taken",
"details": {
}
}
}
In the public and authenticated user roles, I’ve allowed every single one of them, for now.
Enable confirmation emails are set to false.
Email confirmation
Public user permission
For the headers, I’m using Content-type : application/json
the raw json body I'm posting:
{
"email": "manager1#strapi.io",
"password": "testtest1",
"username": "manager1"
}
This is my first project with strapi and so far it went pretty well. I’m not sure if I’m missing out on something or if I’m doing something else wrong.
Any help is appreciated!
I figured it out, it wasn’t as complicated as I expected.
In the user I had different fields, like firstName, lastName etc. All of these fields were required.
I made the fields not required, and now it works.

Delete API - TriggerDeleteAPIPipeline.Run failed

I'm currently having problems when trying to delete an API. Basically I followed all steps detailed here: https://cdas.azure.chevron.com/api-and-integration.wiki/API-Products/Delete-API-Utility.html. But when I hit the submit button at the last step It gives me this error here:
TriggerDeleteAPIPipeline.Run failed: { "error": { "code": 502, "source": "msmanaged-na.azure-apim.net", "clientRequestId": "019d9dd4-976f-4bbd-9e4c-aac428af2577", "message": "BadGateway", "innerError": { "error": { "code": "NoResponse", "message": "The server did not receive a response from an upstream server. Request tracking id '08585506028467688679246934075CU94'." } } } }
Any help on how to report this issue? thanks in advance.
I finally got the issue solved. The problem was that I needed to ask for the Personal access token in "full access scope".

Can we add multiple labelId in history.list API for gmail?

I want to get the result of all INBOX mails and all SENT mails in one API call using the historyID and the history.list Gmail-API.
Refer:
https://developers.google.com/gmail/api/v1/reference/users/history/list
When I am hitting the following GET request :
https://www.googleapis.com/gmail/v1/users/{userID}/history?startHistoryId={historyID}&labelId=SENT&labelId=INBOX
I only get the SENT label messages.
Seems like the API only accepts single & first query param for labelId.
Is there a way to get multiple labelIds' response in a single API call?
I think it would not be possible, I tried making a multiple request and it this response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid label value in query"
}
],
"code": 400,
"message": "Invalid label value in query"
}
}
I would suggest to call it separately for each labelID but you can try filing a feature request for this.
Hope this helps.

google plus auth returning error 401

I am using Google plus auth to log in in web application. It is working properly, but for some time its return error 401. Error JSON is following. I view link Error Description but I did not understand what should I do.
{
"error":
{ "errors":
[
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
As the error page indicated - your access token has likely expired. It sounds like you got an access token once, and are continuing to use it.
Access tokens expire after an hour. After that time, you either need to go through the auth flow again, or use the refresh token to get a new one.

google plus api 403

For some reason I’m not getting the results that I expected using the HTTP POST explorer. I’m getting 403 Forbidden for all userIds that I try.
I used this article to be sure I'm using the correct userId (I even used the userID from the article to see if it was just the ones I tested).
This is where I'm testing: https://developers.google.com/apis-explorer/#p/plusDomains/v1/plusDomains.activities.list
Could there be something wrong with the API?
Here's the full response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
For the Plus Domain API, you need to make sure the user you're authenticating as is part of the domain you're making queries for. See https://developers.google.com/+/domains/authentication/ for more details.