"errorCode":40001,"message":"'message' is required" - sinch

After running the execute command from the quickstart page I get the following error:
curl: (6) Could not resolve host: application
{"errorCode":40001,"message":"'message' is required","reference":"BA:1f96aea6-a1
ae-434c-aaf5-23ed7add6126_Qze9ELkQ0Uq79fIB+4XF0Q"}
Here is the execute command:
curl --user "application\1f96aea6-a1ae-434c-aaf5-23ed7add6126:698vdzO63EGqxBz1wFi4rg=="
--data '{"message":"hello world"}'
-H 'Content-Type: application/json' https://messagingapi.sinch.com/v1/sms/+17203419809
Any ideas?

Related

Generating a Session Key in Windows 10

I am a noob at all this and I am trying to run a Linux curl command in Windows 10 to generate session key. The following is the command in Linux.
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
When I run the command at the Windows command prompt I am receiving the following error.
E:\>curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 18:
author_rotateKeys}'
^
E:\>
Any idea how would I covert the command to work with Windows 10? I just need to generate a key for a node I need to connect to from a Windows box.
If you don't have WSL2 setup (useful if you ever need other *nix tools) where that command will just work as is, or don't want to use PowerShell where
curl.exe -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
works (notice the curl is replaced with curl.exe, because in PowerShell 5.1 curl is just an alias for Invoke-WebRequest, it's removed in PowerShell 6 and later, but they're not built-in and won't replace PowerShell 5.1 when installed), then on Command Prompt replace single quote with double quote, and for double quote inside them, escape it (replace it with \")
curl -H "Content-Type: application/json" -d "{\"id\":1, \"jsonrpc\":\"2.0\", \"method\": \"author_rotateKeys\"}" http://localhost:9933/

elastic search curl command error for bulk import json file "url not specified"

i am new to elastic search trying to bulk import accounts.json file with curl command. but every time got error URL not specified.
elasticsearch and kibana folder are on desktop and also accounts.json file also on desktop.
here is the curl command with error
desktop user$ curl -H 'Content-Type: application/json' -XPOST'localhost:9200/bank/_bulk?pretty&refresh' --data-binary '#accounts.json'
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
please help
You need to use this command to bulk import data:
curl -H 'Content-Type: application/json' -XPOST 'localhost:9200/index-name/_bulk?pretty' --data-binary #my_newline_json.json
Make sure that you have correctly specified the path of your json file in the curl command
Refer to this answer, to know more about this.

jenkins pipeline. curl get works but post doesn't

I'm running Jenkins pipeline job on a windows 10 agent.
i'm trying to publish some information from the agent to confluence.
Running with script.bat:
curl --fail --silent --show-error -u ****:**** -X GET <SomeInternalAddress>
works!
but running:
curl --fail --silent --show-error -u ****:**** -X POST -H 'Content-Type: application/json' -d '#tmpCurlPostData.txt' <SomeInternalAddress>
results with:
curl: (6) Could not resolve host: application
curl: (22) The requested URL returned error: 415
tried escape a '=' in the password with '^'. tried surrounding with quotes.
but with no success.
interesting fact, the same code works fine on win 7,
testing it on a new win 10 machine revealed the problem.
would appreciate any idea guys.
thanks a lot!

Rasa nlu server problem with the error 500 and parsing

I started the nlu server by typing this command in cmd:
rasa run --enable-api -m models/(name of my package).tar
and then in other cmd window typed:
curl localhost:5005/model/parse -d ‘{“text”:“hello”}’
after that I got an error:
{“version”:“1.2.3”,“status”:“failure”,“message”:“An unexpected error
occurred. Error: Failed when parsing body as
json”,“reason”:“ParsingError”,“details”:{},“help”:null,“code”:500}
What is the reason for it? what should I change to get the normal(200) output?
can you please try this and see whether it works.
rasa run -m models --enable-api --cors ‘*’ --debug
CURL POST Request (Mac and Ubuntu):
curl -H "Content-Type: application/json" -X POST -d '{"sender":"y1mLd","message":"hi"}' http://localhost:5005/webhooks/rest/webhook
Note : for windows you need to remove the quotes
curl -H "Content-Type: application/json" -X POST -d {"sender":"y1mLd","message":"hi"} http://localhost:5005/webhooks/rest/webhook
Output
[{"recipient_id":"y1mLd","text":"Welcome, Please let me know how I could be a help today!"}]

How to get H2O automl working from command line using CURL?

I am trying to launch H2O AutoML from command line with CURL and could not get it working..
The base command is something as below:
curl -X POST -H 'application/x-www-form-urlencoded; charset=UTF-8' -d 'training_frame=12cfbae9-af66-42fd-835f-13ccc5a508ab' "http://localhost:54321/99/AutoMLBuilder"
I tried with various parameters with but I always get error as unknown parameter.
I had the use the CURL command as below to make it work:
curl -X POST -H 'Content-Type: application/json' -d '{"input_spec":{"training_frame":"1acfbae9-af66-42fd-835f-13ccc5a508cb","response_column":"mpg","ignored_columns":[],"sort_metric":null},"build_models":{"exclude_algos":[]},"build_control":{"nfolds":5,"keep_cross_validation_predictions":true,"keep_cross_validation_models":true,"balance_classes":false,"class_sampling_factors":[],"max_after_balance_size":5,"stopping_criteria":{"seed":-1,"max_models":0,"max_runtime_secs":30,"stopping_rounds":3,"stopping_tolerance":-1},"project_name":"automl-mpg"}}' http://localhost:54321/99/AutoMLBuilder
Above 1acfbae9-af66-42fd-835f-13ccc5a508cb is the training frame id.

Resources