Reputation: 21
i am trying to update the swagger of an published APi with this curl:
curl -X POST -b cookies "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag" -d 'action=updateAPI&name=datumvalidatie&provider=admin&version=1.0.0&visibility=public&thumbUrl=&description=test&tags=validation&endpointType=nonsecured&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https' -d 'endpoint_config={"production_endpoints":{"url":"https://www.test.com/datumvalidatieWebApi/api","config":null},"endpoint_type":"http"}' -d 'swagger={"basePath" : "/DatumvalidatieWebApi", "paths" : {"/perioden/ingangsdatum" : {"get": {"summary" : "test", "x-auth-type": "Application \u0026 Application User", "deprecated" : false, "produces" : ["application/json", "text/json", "application/xml", "text/xml"], "operationId" : "Ingangsdatum_Get", "responses" : {"200": {"schema" : {"$ref": "#/definitions/Periode"}, "description": "OK"}, "400" : {"schema" : {"type": "array", "items" : {"$ref" : "#/definitions/Object"}}, "description" : "BadRequest"}}, "x-throttling-tier" : "Unlimited", "tags" : ["Ingangsdatum"], "consumes": []}}}, "host" : "*******", "schemes" : ["http"], "definitions" : {"Periode" : {"description" : "Een periode", "type" : "object", "properties" : {"DatumVan " : {"format" : "date-time", "type" : "string"}, "DatumTot" : {"format" : "date-time", "type" : "string"}}}, "Object" : {"type" : "object", "properties" : {}}}, "swagger" : "2.0", "info" : {"description" : "Een collectie methoden om datumvalidaties uit te voeren.", "title" : "datumvalidatie", "version" : "1.0.0"}}'
I get this respond:
"error" : true, "message" : "timeout"
curl: (6) Could not resolve host: \u0026
curl: (6) Could not resolve host: Application
curl: (3) [globbing] bad range in column 43
curl: (3) [globbing] unmatched brace in column 38
curl: (3) [globbing] unmatched close brace/bracket in column 85
curl: (6) Could not resolve host: collectie
curl: (6) Could not resolve host: methoden
......
Does someone know how i can fix this?
Upvotes: 2
Views: 341
Reputation: 12513
I've observed this error when I hadn't logged in before making a service call. Did you login before sending above curl request? If not, login first like this.
curl -X POST -c cookies http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag -d 'action=login&username=admin&password=admin'
This is mentioned at the top of REST API doc.
Upvotes: 1