Get more than 100 tweets Postman/Twitter API v2 - api

I'm using Postman and Twitter API v2 together, to pull data for a paper. I've loaded the "Get more than 100 tweets" library, but it's pagination doesn't seem to be working.
I keep getting this error (listed below, in bold):
"errors": [
{
"parameters": {
"pagination_token": [
"b26v89c19zqg8o3fpz8mukx3mf6m7ag90u7sjx2xy61kt"
],
"next_token": [
"1"
]
},
**"message": "At most one of [pagination_token, next_token] can be provided."**
}
],
"title": "Invalid Request",
"detail": "One or more parameters to your request was invalid.",

Related

how can I manage custom errors coming from the server?

I use Jhipster with react as frontend with loopback as server side, I should show custom error ( ex. tax code already present in the archive).
this is format error
{
"error": {
"statusCode": 422,
"name": "UnprocessableEntityError",
"message": "The request body is invalid. See error object `details` property for more info.",
"code": "VALIDATION_FAILED",
"details": [
{
"path": "partitaIva",
"message": "Partita Iva già presente",
"code": "CUSTOM_ERROR",
"info": {}
}
]
}
}
There could be more errors too, like for a form.
I want to know how to display the error returned by server.

Unable to convert currency paypal pay API error

I am using paypal adaptive payment API.
https://svcs.sandbox.paypal.com/AdaptivePayments/Pay
Request payload
{
"actionType":"PAY",
"memo":"Example",
"preapprovalKey":"PA-4PV844316B104562R",
"receiverList":{"receiver":{"amount":"14.00","email":"reveiver.email#gmail.com"}},
"currencyCode":"CHF",
"requestEnvelope":{"errorLanguage":"en_US"},
"pinType":"NOT_REQUIRED",
"feesPayer": "SENDER",
"senderEmail":"sender.email#gmail.com",
"returnUrl":"http://www.google.com/?paypal=ok",
"cancelUrl":"http://www.google.com/paypal=cancel",
"clientDetails": {
"applicationId": "APP-80W284485P789543T"
}
}
Getting response
{
"responseEnvelope": {
"timestamp": "2018-11-05T20:45:14.602-08:00",
"ack": "Failure",
"correlationId": "1609b946b9c72",
"build": "50069244"
},
"error": [
{
"errorId": "520002",
"domain": "PLATFORM",
"subdomain": "Application",
"severity": "Error",
"category": "Application",
"message": "Internal Error",
"parameter": [
"Unable to convert currency"
]
}
]
}
If I send currencyCode:"USD" then it work fine But when i pass currencyCode:"CHF" Then it gives error in response. My all sandbox account currency is CHF. Till 26th Oct it's working but suddenly gives error when i check on 3rd Nov.
Base on my debugging, it happens when you have more than one receiver, currency is not USD and reverseAllParallelPaymentsOnError is set to true.
When reverseAllParallelPaymentsOnError is set to false, the transaction is pushing through.
Not a solution though, I'm still checking for other solution.

Blogger API We're sorry, but the value for field labels was not valid

When I submit the following json format article to blogger
{
"title": "Title",
"content": "Content",
"labels":["adventviures", "3ds", "game", "nintendo", "bgr", "metroid", "to", "fox", "Balrog", "bgr", "avi", "review", "addicted", "pikmin", "balrog", "bngr", "bgra", "eshop", "new 3ds", "star", "pokemon", "balrogthemaster", "mario", "thoughts", "on"]
}
I get the following error message
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "We're sorry, but the value for field labels was not valid."
}
],
"code": 400,
"message": "We're sorry, but the value for field labels was not valid."
}
Some other labels do not work
1."labels":["CauBeNguNgo","Xe Đua","GTA 5","Thành Trung Gaming","Xe Lamborghini","siêu xe đua","game offline","Cris Devil GamerGame Offline"]
2."labels":["Google israel","Google","entertainment","YouTube Japan 公式チャンネル","YTMA","YouTube","Science & Technology","エンタメ","entame","Awards","YouTube Japan","Music"]}
I would like to know if the blogger's labels comply with the rules, I do not find it
Please help me

UDFs with the php api library

I am trying to add a UDF (I've tried both options of inline vs on cloud storage) and always get the same messsage:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidQuery",
"message": "Unknown TVF: funcName",
"locationType": "other",
"location": "query"
}
],
"code": 400,
"message": "Unknown TVF: funcName"
}
}
I set the resource via.
$udf_resource = new Google_Service_Bigquery_UserDefinedFunctionResource();
$udf_resource->setResourceUri('gs://path/to/bucket/funcName.js');
or
$udf_resource = new Google_Service_Bigquery_UserDefinedFunctionResource();
$udf_resource->setInlineCode("FUNC_NAME_CODE");
both are being inserted into a job query config via.
$query_config->setUserDefinedFunctionResources($udf_resource);
The udf runs fine via. the Web UI.
Is there something I am missing?
passing array to setUserDefinedFunctionResources(), e.g.
$query_config->setUserDefinedFunctionResources([$udf_resource]);

Error loading file stored in Google Cloud Storage to Big Query

I have been trying to create a job to load a compressed json file from Google Cloud Storage to a Google BigQuery table. I have read/write access in both Google Cloud Storage and Google BigQuery. Also, the uploaded file belongs in the same project as the BigQuery one.
The problem happens when I access to the resource behind this url https://www.googleapis.com/upload/bigquery/v2/projects/NUMERIC_ID/jobs by means of a POST request. The content of the request to the abovementioned resource can be found as follows:
{
"kind" : "bigquery#job",
"projectId" : NUMERIC_ID,
"configuration": {
"load": {
"sourceUris": ["gs://bucket_name/document.json.gz"],
"schema": {
"fields": [
{
"name": "id",
"type": "INTEGER"
},
{
"name": "date",
"type": "TIMESTAMP"
},
{
"name": "user_agent",
"type": "STRING"
},
{
"name": "queried_key",
"type": "STRING"
},
{
"name": "user_country",
"type": "STRING"
},
{
"name": "duration",
"type": "INTEGER"
},
{
"name": "target",
"type": "STRING"
}
]
},
"destinationTable": {
"datasetId": "DATASET_NAME",
"projectId": NUMERIC_ID,
"tableId": "TABLE_ID"
}
}
}
}
However, the error doesn't make any sense and can also be found below:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Job configuration must contain exactly one job-specific configuration object (e.g., query, load, extract, spreadsheetExtract), but there were 0: "
}
],
"code": 400,
"message": "Job configuration must contain exactly one job-specific configuration object (e.g., query, load, extract, spreadsheetExtract), but there were 0: "
}
}
I know the problem doesn't lie either in the project id or in the access token placed in the authentication header, because I have successfully created an empty table before. Also I specify the content-type header to be application/json which I don't think is the issue here, because the body content should be json encoded.
Thanks in advance
Your HTTP request is malformed -- BigQuery doesn't recognize this as a load job at all.
You need to look into the POST request, and check the body you send.
You need to ensure that all the above (which seams correct) is the body of the POST call. The above Json should be on a single line, and if you manually creating the multipart message, make sure there is an extra newline between the headers and body of each MIME type.
If you are using some sort of library, make sure the body is not expected in some other form, like resource, content, or body. I've seen libraries that use these differently.
Try out the BigQuery API explorer: https://developers.google.com/bigquery/docs/reference/v2/jobs/insert and ensure your request body matches the one made by the API.