A newer version of this documentation is available.

View Latest

Request with authentication - request parameter

  • concept
    +

    If a request requires more than one set of credentials, the creds parameter must be used, as in this example.

    Request
    $ curl -v http://localhost:8093/query/service \
         -d 'statement=SELECT t.text FROM tweets t
         JOIN users u KEY t.uid LIMIT 1
         &creds=[{"user": "local:tweets", "pass": "pAss1"}", {"user": "local:users", "pass": "pAss2"}]'
    Response:
        < HTTP/1.1 200 OK
             {
             "requestID": "11ed1981-7802-4fc2-acd6-dfcd1c05a288",
             "signature": {
             "text": "json"
             },
             "results": [
             {
             "text": "Couchbase is my favorite database"
             }
             ],
             "status": "success",
             "metrics": {
             "elapsedTime": "3.455608ms",
             "executionTime": "3.116241ms",
             "resultCount": 1,
             "resultSize": 65,
             "mutationCount": 0,
             "errorCount": 0,
             "warningCount": 0
             }
             }