Unable to send POST request to DialogFlow (404) - google-cloud-platform

I am working on upgrading a 3 year old api.ai app to DialogFlow. I have modified the request using the Migration Guide. I get a 404 error using the base url:
https://dialogflow.googleapis.com/v2/{session=projects/Project_ID/agent/sessions/1}:detectIntent
This is from the detectIntent documentation. I am trying to use the detectIntent method, but I was having the same problem when I tried to use context. Additionally, I have tried on multiple networks. I even get a 404 when I put it in a browser. Any idea what is incorrect in my URL?

As noted at the documentation for detectIntent, the URL uses Google API HTTP notation to document parameters and how they need to be specified. That second link isn't very useful, but basically it means that you can interpret the URL
https://dialogflow.googleapis.com/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent
as
The parts outside the {} are literal. That is exactly what you should be sending in the URL.
The {} is not literal. It specifies a parameter.
The part inside the {} is a parameter named "session".
The "session" parameter takes the form of a string that has two portions that can be a single path segment (the description of detectIntent puts additional limitations on these portions, but sometimes this is specified in the notation) and the rest is a literal path.
So if the session is projects/12345/agent/sessions/6789 then the URL will be
https://dialogflow.googleapis.com/v2beta1/projects/12345/agent/sessions/6789:detectIntent

Related

How can I pass tenant value in the URL via Integration Studio?

I have a multi tenant API and I am trying to RESTIFY it using wso2. I am trying a way to pass the tenant value in the url.
localhost:8290//tenant/api/...
https://tenant.xyz.com/api/...
I tried İntegration studio and i managed to pass a literal tenant value in http endpoint by creating a property named {uri.var.tenant} and setting it to tenant name. However, I don't know how can I take the tenant name from here
localhost:8290//tenant/api
and pass it here.
https://tenant.xyz.com/api/
I also tried using the APIM publisher page with no success.
As I see, there are 2 parts for your question.
How to parameterize the backend URL.
How to read the path parameter from the fronting API that is being called.
For the first one, the method you have followed is correct and an example can be found at https://apim.docs.wso2.com/en/latest/integrate/examples/endpoint_examples/using-http-endpoints/#example-1-populating-an-http-endpoint-during-mediation . What's remaining is to read the path parameter and to populating {uri.var.tenant} which is the second point.
For the second point, you can create and API definition with the URL templated. See the property URI Template at https://apim.docs.wso2.com/en/latest/reference/synapse-properties/rest-api-properties/ you can find an example of the usage at https://apim.docs.wso2.com/en/latest/integrate/examples/rest_api_examples/setting-query-params-outgoing-messages/#reading-a-query-or-path-parameter

setNextRequest() in Postman

I am trying to set a request after a certain request in postman, but It is not working as I want it to be. I have read through Postman documentation but got no luck. Plus, how do I get postman's request ID?
I am using the given JavaScript in the Test tab, and in postman documentation it says it should work. But no luck.
postman.setNextRequest('Login');
postman.setNextRequest('Login') will work only inside the Runner. Also, the requests need to be in the same Collection.
Even if the request is in another folder (while still in the same collection), you can reference it in setNextRequest(), without having to specify any folder.
And to answer your second question, "how to get the Postman Request Id?"
Use this pm.info.requestId which will return string value, you may set that in environment variable as well, like pm.environment.set("rID", pm.info.requestId)

Jmeter 406 error - token not found

I'm using Jmeter for the first time to test the Load from a website. But there are exactly 3 API's that don't seem to work. The three of them have the same error page at the View Results Tree (I translated the error message to english):
The Test Plan already has the HTTP Request Defaults, HTTP Cookie Manager, HTTP Header Manager and Recording Controller.
How can I solve that problem or know which is the Token that is missing? Some API's that come after it have a Cookie Data called .ASPXAUTH. Is that the token I need?
It is quite hard to guess without seeing your request and response details, you can identify the required dynamic parameter (token or whatever) by recording your test one more time and compare resulting .jmx files for differences.
Carefully inspect everything as the token might come as a Cookie, as a Header, as a part of the response URL after redirection or in the response body and use the relevant JMeter's Post-Processor to extract it from the previous response and add to the next request.
The process is known as correlation and you should be able to find a plenty of information on different approaches over the web via jmeter correlation query in your favorite search engine.
You may also be interested in an alternative way of recording a JMeter test which automatically detects and works around dynamic parameters so you won't have to do this manually, check out How to Cut Your JMeter Scripting Time by 80% article for more details.

Postman inconsistent behaviour with cURL request

I have the following API downloaded in JSON from Swagger Editor:
PUT http://10.37.64.243/m2m/fim/items/fim:device:manager/operations/getAllDeviceTypes?exclude={{exclude}}
with exclude being an environment variable set as : href,metadata,name,arguments
Nominal use requires basic authentication, in this case it works and I get a JSON body with expected result. It properly works in Postman (so I think my import is correct)
If no authentication is provided:
in Swagger Editor : nominal behaviour, request is rejected with error code 401
in Postman : UNEXPECTED behaviour, I end up with status code 200 and it returns a response body identical to the one that I get when authenticated
if I generate the cURL code snippet from Postman and launch it out of Postman: nominal behaviour, I get the same error as the one I get in Swagger Editor (the one expected)
Why do Postman behave differently from the cURL request ??
I probably do something wrong, but I can't figure out what
Thanks for any help
Alexandre
I finally found out that the server returns a cookie that holds authentication validation. So after a valid authentication, whatever the request (with or without authentication) it will be considered as authentified.
Unfortunately, the only way to overcome that problem is to remove the cookie by hand through the "Manage cookies" window. Postman does not implement a function that erase it (even through the pm.cookies and pm.cookies.clear() function).
Postman developpers are aware of that, but there's no scheduling for this feature ...
EDIT: the feature is followed here https://github.com/postmanlabs/postman-app-support/issues/3312

Web App not Found-edit in DatasheetView

i came accross the following error, when my client tries to edit list data through datasheet view from terminal machine.
The Web application at xxx could not be found. Verify that you have typed the URL
correctly. If the URL should be serving existing content, the system administrator may
need to add a new request URL mapping to the intended application.
Note: this error is coming with only 1 list. All other lists are working fine. i m using sharepoint 2007 on 32bit
This may be related to alternate access mappings.
I had this issue, and the clue was that the datasheet was referencing a URL of the form:
_http://hostname/site/...
instead of
_http://hostname.domain/site/...
ie. the datasheet was not referencing the fully qualified domain name (FQDN).
If the error message states The Web application at _http://hostname/site/..., ie. the error doesn't use the FQDN, alternate access mapping may resolve it. The end of the error message seems to suggest alternate access mappings, although it is not entirely explicit.
I resolved this by adding an alternate access mapping as follows:
internal url: http://hostname
public url: http://hostname.domain (FQDN)
Default Zone in my case, should work for other zones.
hope this helps :)