How to call whatsmate translation API on the Bowser? - api

subscribed to their API today, I was wondering about how I can call their API on the browser
they already provided this, I tried a lot but I didn't get anything
See Their API Reference https://whatsmate.github.io/api-reference/
Translation Endpoints
1. Translate text
Endpoint: POST /v1/translation/translate
Parameters required in JSON payload:
fromLang: String. The code representing the language of the supplied text.
toLang: String. The code representing the language you want the text to be translated to.
text: String. The piece of text you want to be translated.
List of language codes: See the next endpoint.
Response: String. The translated text.

Related

Searching a draft scenario, the api returns an empty array, and did not tell me a error type: Voximplant Kit

https://voximplant.com/kit/docs/references/kit/scenarios#searchscenarios
Are the scenarios that I get via searchScenarios method limited by some status, like "in use"? I search a draft scenario, the api returns an empty array, and did not tell me a error type.
The searchScenarios method returns all scenarios by default. You may use additional parameters like 'with_campaigns' or 'with_phones' to see if the scenario is in use. You may see all the additional parameters in our documentation: https://voximplant.com/kit/docs/references/kit/scenarios#searchscenarios

How to convert date (1991-08-23T00:00:00) which is captured in response and then convert this format (08-23-1991) in vugen?

I am working on a script where I need to submit a form and do some authentication during the steps. I am using LoadRunner Vugen for scripting. For one of the request's response I can see birthdate is coming like below:
"suffixName": ""
"birthDate": "1991-08-23T00:00:00",
"agencyName": ""
In another later request I can see in jason body the same date is used like below
"Body={\agentSuffix":null,"agentFirstName":"XYZ","agentLastName":"WSD","agentBirthDate":"08-23-1991" and so on with additional body.
I am able to capture the date from response by using web_reg_save_param_ex. But now how do I convert the value so that I can use it in next jason body in a custom request. I just need help to capture it.
Captured value: 1991-08-23T00:00:00
Expected value: 08/23/1991
Thanks in advance
Correlate for the string
Use your programming skills in the language of your virtual user to transform transform the string into a new string. Your test code might be C, JavaScript, Java, ... so use language-appropriate string conversion functions.
Hints
"LB=birthDate":"", "RB=T00:00:00"
Conside the loop and what this means for the use of substring and sprintf();
for (counter=0;counter<=strlen(lr_eval_string(MyCorrelatedVarName));counter++)
{ lr_message("%s",&lr_eval_string(MyCorrelatedVarName)[counter]); }

Slack API - Don't notify user when parsing user id

In this message formatting doc: https://api.slack.com/docs/message-formatting, you can use special control sequence characters < and > to perform server-side parsing (server-side as in Slack API's server-side).
So using <#U024BE7LH> in your chat.postMessage() call will get parsed to something like #bob or whatever the username associated with that ID is, in the actual text that shows up in slack.
Unfortunately, this will cause a notification for the person you're referring to. How do I make it so that it doesn't notify the person? I've tried to enclose in a code block, i.e.:
`<#U024BE7LH>`
or
```
<#U024BE7LH>
```
But it still pings. I'm thinking the only way is to get a list of users and parse the name from the ID.
According to this, backticks should work but empirically it hasn't for me. The Slack employee says to just convert the user ID to their name and use that without the templating.
https://forums.slackcommunity.com/s/question/0D73a000005n0OXCAY/detail?language=en_US&fromEmail=1&s1oid=00Dj0000001q028&s1nid=0DB3a000000fxl3&s1uid=0053a00000Ry9cX&s1ext=0&emkind=chatterCommentNotification&emtm=1667894666436&emvtk=fH.W2M01lq9W1cf31RSROPwB7LYs.och8RgbVTqoNlg%3D&t=1667931570045

AFNetworking invalid JSON format returned

I need to query the Yahoo stock query service in an iOS application using AFNetworking.
The query returns the following result;
YAHOO.Finance.SymbolSuggest.ssCallback({"ResultSet":{"Query":"yahoo","Result":[{"symbol":"YHOO","name":"Yahoo! Inc.","exch":"NMS","type":"S","exchDisp":"NASDAQ","typeDisp":"Equity"},{"symbol":"YHOF.EX","name":"YAHOO","exch":"EUX","type":"S","exchDisp":"EUREX Futures and Options Exchange ","typeDisp":"Equity"},{"symbol":"YOJ.BE","name":"YAHOO JAPAN","exch":"BER","type":"S","exchDisp":"Berlin","typeDisp":"Equity"},{"symbol":"YHOO.MX","name":"Yahoo! Inc.","exch":"MEX","type":"S","exchDisp":"Mexico","typeDisp":"Equity"},{"symbol":"YHO.DU","name":"YAHOO","exch":"DUS","type":"S","exchDisp":"Dusseldorf Stock Exchange ","typeDisp":"Equity"},{"symbol":"YAHOY","name":"Yahoo Japan Corporation","exch":"PNK","type":"S","exchDisp":"OTC Markets","typeDisp":"Equity"},{"symbol":"YAHOF","name":"Yahoo Japan Corporation","exch":"PNK","type":"S","exchDisp":"OTC Markets","typeDisp":"Equity"},{"symbol":"YOJ.SG","name":"YAHOO JAPAN","exch":"STU","type":"S","exchDisp":"Stuttgart","typeDisp":"Equity"},{"symbol":"YHOO.SW","name":"YAHOO","exch":"EBS","type":"S","exchDisp":"Swiss","typeDisp":"Equity"},{"symbol":"YHO.HM","name":"YAHOO","exch":"HAM","type":"S","exchDisp":"Hamburg","typeDisp":"Equity"}]}})
As the you can see, the JSON is not formatted properly. Specifically speaking, the YAHOO.Finance.SymbolSuggest.ssCallback() is not needed and causes the JSON formatter to crash.
Is there a way to tell AFNetworking to kind of skip the text that isn't part of the actual JSON?
Edit:
Upon #rckoenes request; This is how the webservice is used;
http://www.jarloo.com/yahoo-stock-symbol-lookup/
Well it looks like this is not a public API, so you might not be allowed to use it. Off course you still can. Just create your own response serializer end before you decode the JSON remove first part with seem simple string replace and remove the last charter. This should return valid JSON.

How to retrieve Wikidata entry from Wikidata search results?

I make a Wikidata search request like this (autocomplete use case):
https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&language=en&type=item&continue=0&search=photog
And the service returns a JSON response thus
{
id: "Q11633",
url: "//www.wikidata.org/wiki/Q11633",
description: "art, science and practice of creating durable images by recording light or other electromagnetic radiation",
label: "photography"
}
But how do I look up to get retrieve the content?
I can only find a title search which does not recognize the Q parameter. It only recognizes titles.
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Photography
You want to use wbgetentities, another method of WikiData's extension to the MediaWiki API (WikiBase). In its most basic form, it looks like this:
api.php?action=wbgetentities&ids=Q11633
You probably want to reduce the size of the reply, by specifying what you what to know about the entity, using the props parameter.