nuclia/support

API access

Closed this issue · 1 comments

Hi,

I have setup access via a new API and trying to index from the Drupal search_api_nuclia module and I keep getting http 403 permission errors?

NucliaDB returned an error (HTTP Code 403) while creating resource.

This error means that the NucliaDB server is denying access to the resource that you are trying to create. This could be due to a lack of permissions or incorrect authentication credentials. To fix this, you should check the permissions and authentication credentials for the resource and make sure that they are correct. You may also need to contact your NucliaDB administrator to make sure that you have the necessary permissions to create the resource.

I have tried many different permutations with no luck so far? I have reviewed training videos and documentation but no matter what config options I try I have no access.

Is this an account permissions issue?

Thanks.

Hi @rod-higgins,

The first thing I would do is to check if your access token is ok or not.
To do so, you can just run this curl command:

curl https://europe-1.nuclia.cloud/api/v1/kb/<your-knowledge-box-id>/resources \
  -i X POST \
  -H "X-STF-Serviceaccount: Bearer <your-service-access-token>" \
  -H "Content-Type: application/json" \
  -d '{"title":"Little Prince","texts":{"chapter-1":{"format":"PLAIN","body":"Draw me a sheep"}}}'

(Note: you can use Postman instead of curl if you prefer)

If it fails, it means your token is wrong (maybe wrongly copied or something), just create a new one.
If it succeeds, it might mean the token is not stored properly in your Drupal settings.