Not able Perform CRUD operation through couchbase sync gateway using Rest API

{
“bootstrap”: {
“server”: “couchbase://localhost”,
“use_tls_server”: false,
“username”: “Administrator”,
“password”: “password”
},
“api”: {
“public_interface”: “0.0.0.0:4984”,
“admin_interface”: “127.0.0.1:4985”,
“https”: {}
},
“bucket_credentials”: {
“test-without-scope”: {
“password”: “Password”,
“username”: “Administrator”
}
},
“logging”: {
“log_file_path”: “./sync_gateway_log.log”,
“console”: {
“enabled”: true
},
“debug”: {
“enabled”: true
},
“error”: {
“enabled”: true
},
“info”: {
“enabled”: true
},
“warn”: {
“enabled”: true
}
},
“database_credentials”: {
“test-without-scope”: {
“username”: “Administrator”,
“password”: “password”
}
},
“auth”: {},
“replicator”: {},
“unsupported”: {
“serverless”: {}
}
}

Above is my bootstrap.json file.
I am trying to perform a CRUD operation using Postman but getting the following error:
I have created user in my couchbase server and used that user in authentication (Basic authentication with username and password)
{
“error”: “Unauthorized”,
“reason”: “Invalid login”
}

You’ve not specified what port or API endpoint you’re sending a request to, but:

If you’re using the Admin API, you’ll need to supply Couchbase Server user credentials that have the appropriate permissions for the endpoint you’re trying to use.

See the docs here:

If you’re using the Public API, you’ll need to create a Sync Gateway user (via the Admin API) and then use that user in your request!

Docs:

{
“bootstrap”: {
“server”: “couchbase://localhost”,
“use_tls_server”: false,
“username”: “Administrator”,
“password”: “password”
},
You can see I have already specified server address as “couchbase://localhost”.
If I specify port like “couchbase://localhost:8091” then the sync gateway will throw the error as follows (Refusing to establish the connection):
Couldn’t start Sync Gateway: couchbase://host:8091 not supported for couchbase:// scheme. Use couchbase://host – rest.ServerMain() at main.go:33
Apart from this, I am using user having role as Administrative role (which I created from couchbase server UI).

I’m talking about the requests you’re making from Postman.

Ports 4984 and 4985 correlate with the Public API and Admin API

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.