ApiAxle: Modifying timeout parameter if backend server is slow to respond - timeout

I am following the instructions at: and am getting the error: http://apiaxle.com/docs/try-it-now/
{"meta":{"version":1,"status_code":504},
"results":{"error":{"type":"EndpointTimeoutError",
"message":"API endpoint timed out."}}}
I'm searching on google but have not yet found how to set a larger timeout.

Looking at the documentation at http://apiaxle.com/api.html, I took a shot and came up with the following:
axle> api "apiname" create endPoint="server.org:port" endPointTimeout=30
Response was:
{ protocol: 'http',
tokenSkewProtectionCount: 3,
apiFormat: 'json',
endPointTimeout: 30,
disabled: false,
strictSSL: true,
sendThroughApiKey: false,
sendThroughApiSig: false,
hasCapturePaths: false,
allowKeylessUse: false,
keylessQps: 2,
keylessQpd: 172800,
endPoint: 'server.org:port',
createdAt: 1400333254388 }
axle> api apiname linkkey "1234"
Response was:
{ qpd: 172800, qps: 2, disabled: false, createdAt: 1400331617778 }

To modify an existing api :
api "apiname" update endPointTimeout=10

Related

cypress 10 is not reading specPattern value after exporting new value to it

I'm facing an issue that i couldn't find a solution for it.
We have updated the version of the cypress from 9.7.0 to 10.2.0 recently, and we used to set the value of testFiles for Docker image using export CYPRESS_TEST_FILES="some files or paths"
Now the testFiles changed to specPattern, and when we use the same method, a new parameter is added to env{} object, and the existing one outside env{} object is still the same.
Now we need a way to change the value of specPattern by exporting the value (we need to change it only in some cases, and not through cypress.config.ts)
cypress.config.ts content:
import { defineConfig } from 'cypress' export default defineConfig({ env: { webBaseUrl: 'http://localhost:4200', highlightColor: '#9ef11a', download_dir: '/cypress/downloads/', }, viewportWidth: 1680, viewportHeight: 1050, defaultCommandTimeout: 15000, reporter: 'mochawesome', video: false, retries: { runMode: 1, openMode: 1, }, reporterOptions: { reportDir: 'cypress/results', overwrite: false, html: false, json: true, }, e2e: { setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, baseUrl: 'https://localhost', specPattern: 'cypress/e2e/**/*.cy.ts', }, })
i tired:
export CYPRESS_specPattern="cypress/e2e/**/*.spec.ts"
then run cypress:
in the settings are i got the following:
and this is the other specPattern value
and it's clear that it's taking the second one into consideration
any suggestions?

Square Point of Sales API sending reference_id or userInfoString

I'm using point of sales API to integrate a webapp with Square point of sales for IOS.
according to the API, if I send a reference in my transaction request I'll get that reference back in the response URL and that's what I want to use that reference for further processing in my app.However I'm not getting the reference in the response so I guess something is wrong in my request
this is my request object
var dataParameter = {
amount_money: {
amount:amount * 100,
currency_code: "USD"
},
callback_url: myURL,
reference_id: referenceId,
client_id: applicationId,
version: "1.3",
notes: "this is a test",
options: {
supported_tender_types: ["CREDIT_CARD", "CASH"],
auto_return: true
}
}
I also tried "userInfoString" instead of "reference_id" and it didn't work.

Twitter: Error sending Direct message with quick reply buttons

I need to send a Twitter DM with quick reply.
I use Tweetinvi, that at the moment does not support quick replies, therefore I tried to alter the query in Tweetinvi code at the lovest possible level: just before it is sent to Twitter.
If I send this (basic message)
https://api.twitter.com/1.1/direct_messages/new.json?text=hello&user_id=999999999
It works
When I send is this
https://api.twitter.com/1.1/direct_messages/new.json?text=MessageToUserId&user_id=999999999&quick_reply&type=options&options=[label=RedBird&description=Adescriptionabouttheredbird.&metadata=external_id_1]
I get status 401 Web request failed.
To build my request I tried to simplify this example:
https://developer.twitter.com/en/docs/direct-messages/quick-replies/api-reference/options
But I am missing something. I suppose it is a trivial mistake in the query. I tried several variations, but I cannot get a better result. Of course in my code I use a real userId, that here I masked with 9.
Can you suggest me a working correction to my query? (maybe with examples using multiple labels)
Update.
I tried to use TwitterAccessor (without hacks in Tweetinvi code) and improved the json
Here is my updated code
Auth.SetUserCredentials(consumerKey, consumerSecret, userAccessToken, userAccessSecret);
var authenticatedUser = User.GetAuthenticatedUser();
var qString = JsonConvert.DeserializeObject("{ 'event': { 'type': 'message_create', 'message_create': { 'target': { 'recipient_id': '123456789' }, 'sender_id': '987654321', 'message_data': { 'text': 'option?', 'quick_reply': { 'type': 'options', 'options': [ { 'label': 'option 1', 'metadata': 'val1', 'description': 'option 2' }, { 'label': 'val2', 'metadata': 'option 3', 'description': 'val3' } ] } } } } }");
var strEncoded = WebUtility.HtmlEncode(qString.ToString());
var url = "https://api.twitter.com/1.1/direct_messages/events/new.json";
var result = TwitterAccessor.TryExecutePOSTQuery($"{url}?{strEncoded}");
Now I have error 401, with this description:
"Unauthorized - Authentication credentials were missing or incorrect."
Which is much better. Probably I just need to add credential headers using TwitterAccessor, but I need help about this.
I suppose that adding something TwitterAccessor. Method to create credentials headers before the post should do the job.

ionic 2 FileOpener, mime-type is null

i use FileTransfer-Plugin to download a file over a API. After download i want open the file with FileOpener-Plugin. FileOpener requires the mime-type of the file, but data.type (mime-type) returns null.
File.resolveLocalFilesystemUrl(cordova.file.cacheDirectory)
.then((dirEntry) => {
this.transfer.download(url, path, true, {headers: headers})
.then((entry) => {
entry.file((data) => {
console.log('MimeType: ', data.type); // returns null
});
});
});
it works without setting mime-type, but i think it is better with. Anybody knows about this Problem. I working in iOS.
data returns:
end: 683008
lastModified: 1497256786396.6
lastModifiedDate: 1497256786396.6
localURL: "cdvfile://localhost/cache/file.ext"
name: "file.ext"
size: 683008
start: 0
type: null

Google Tag Manager mobile variables corrupted

When I create a user-defined variable I have problems with the JSON formatting
{
"banner": {
"bannerAdsEnabled": true,
"bannerAdLocationTop": false
},
"interstitial": {
"interstitialAdsEnabled": true,
"maxInterstitialsPerDay": 10,
}}
When I do it this way I always get
GoogleTagManager error: Invalid macro:
GoogleTagManager error: Failed to parse an invalid boolean:
The only solution I found is to format my variable as follows:
{
"bannerAdsEnabled": true,
"bannerAdLocationTop": false,
"interstitialAdsEnabled": true,
"maxInterstitialsPerDay": 10 }
I a video from Google I/O '13 the guy is formatting the the way I want to do it and it is working. What am I doing wrong?

Resources