ibm-cloud-docs / Cloudant

11 stars 48 forks source link

How to get the user accesses assigned to Databases #22

Closed kiranshashiny closed 4 years ago

kiranshashiny commented 4 years ago

I'm referring to this document,

https://cloud.ibm.com/docs/services/Cloudant/api?topic=cloudant-databases

I am running curl and doing a GET to view the database "mydb" that was created using the Cloudant Dashboard on the IBM portal.

I'm getting an error.

{"error":"unauthorized","reason":"_reader access is required for this request"}

How do I resolve it ?

The curl get is (removed the part of identifier in my https:// request below for security reasons. )

curl -i -H "Accept: application/json" -H "Content-Type: application/json" https://xx-bluemix.cloudantnosqldb.appdomain.cloud/mydb

II.

I'm trying to PUT to create a new DB as listed in your Document page.

{"error":"unauthorized","reason":"one of _admin, server_admin is required for this request"}

The script is as shown.

$ cat curlput.sh 
curl -X PUT "https://...2f-bluemix.cloudantnosqldb.appdomain.cloud/anotherdb?partitioned=true"

Would appreciate if you would put up some trouble shooting tips too.

lbboe commented 4 years ago

Hello, Thank you for reaching out. Please verify that your service credentials match the ones in Cloudant Dashboard. If you're not sure how to find them, this topic walks you through it, https://cloud.ibm.com/docs/services/Cloudant?topic=cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud#locating-your-service-credentials. You can also find more information here, https://cloud.ibm.com/docs/services/Cloudant/api?topic=cloudant-authorization.

Thanks, Lora