1

I have built a Bubble App and need to integrate it with a application custom model I am building in Clarifai but when I use the Bubble API plugin to connect to do an image predict it says I have an authentication issue 10002 Bubble API header details

Bubble API header details

Bubble POST call Bubble POST call

what am I doing wrong???

Rayees AC
  • 4,426
  • 3
  • 8
  • 31
ngittins
  • 11
  • 1
  • are you replacing the placeholders with actual values such as the model_id and such – Clarifai Support Sep 22 '20 at 19:14
  • yes was adding the model ID but I dont think its even getting that far as it says authentication issues clarifai error code 10002 - what should the URL look like? its not clear in the documentation – ngittins Sep 24 '20 at 14:53
  • I am now getting this "status": { "code": 11102, "description": "Invalid request", "details": "Empty or malformed authorization header. Please provide an API key or session token.", "req_id": "400d685401734e8da070351d93f8a82f" }, "outputs": [] – ngittins Sep 24 '20 at 15:20
  • The message says that you are not providing the API key, please check your request to make sure that you are providing the API key and in the correct format. – Clarifai Support Sep 24 '20 at 16:56
  • this is the curl code from postman test url --location --request POST 'https://api.clarifai.com/v2/workflows/auto-1/results' \ --header 'Authorisation: api_key 060ca1b47THIS BIT REDACTED7ad' \ --header 'content-type: application/json' \ --data-raw '{ "inputs": [ { "data": { "image": { "url": "https://samples.clarifai.com/metro-north.jpg" } } } ] }' – ngittins Sep 28 '20 at 11:32
  • you are spelling Authorization wrong – Clarifai Support Sep 28 '20 at 14:38
  • as you are developing this please note that Bubble, in the past, has not been a reliable source to use for integrating Clarifai's API – Clarifai Support Sep 28 '20 at 16:13
  • I think you will find the difficulty arises around the quality of the API documentation for URL POST/GET requests I am trialing 3 other platforms and all of them work fine on the API unfortunately Clarifai is the only one that isnt clear on url and parameter structures - i cant even get it to connect in postman! which is a shame because I prefer the Clarifai platform – ngittins Sep 29 '20 at 15:51
  • Could you share the full cURL request that you will put up in a command line, not Postman or any other tool. If you are making calls to a general model you will follow the directions here https://docs.clarifai.com/api-guide/predict/images#via-url – Clarifai Support Oct 02 '20 at 14:43
  • if you are making it to a custom model then the predict cURL request will be like the following. If you can post your full cURL request from the command line in your question that would be helpful https://docs.clarifai.com/api-guide/walkthroughs/custom-model-walkthrough#predict-with-the-model – Clarifai Support Oct 02 '20 at 14:46
  • curl --location --request POST 'https://api.clarifai.com/v2/models/Lounge_basic/versions/e37934070c894dcca6d9050ecb63fe55/outputs' \ --header 'Authorization: key 060ca1b47c2540cXXXXXXXXXXXXXXX' \ --header 'Content-Type: application/json' \ --data-raw '{ "inputs": [ { "data": { "image": { "url": "https://samples.clarifai.com/metro-north.jpg" } } } ] }' – ngittins Oct 05 '20 at 14:46

1 Answers1

0

Please try using the following cURL command and replacing it with your variable. I have tested it on my side and it works. As for the Bubble issue, that is something you would need to contact their Support about. We are not sure how they are processing their requests but Bubble doesn't seem to able to handle API calls from Clarifai.

curl -X POST \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
  {
    "inputs": [
      {
        "data": {
          "image": {
            "url": "https://samples.clarifai.com/metro-north.jpg"
          }
        }
      }
    ]
  }'\
  https://api.clarifai.com/v2/models/{YOUR_MODEL_NAME}/outputs
  • I have the same problem. -H "Authorization: Key YOUR_API_KEY" not working! I get the error 10002 with CURL `Empty or malformed authorization header. Please provide an API key or session token` – Vova Jan 06 '21 at 15:59
  • Having same error in my Nodejs project. Using ClarifAI's official client for Nodejs https://github.com/Clarifai/clarifai-nodejs-grpc. Also tested with above curl command and got the same result {"status":{"code":11102,"description":"Invalid request","details":"Empty or malformed authorization header. Please provide an API key or session token.","req_id":"f8bd4f62a31f4e748111a3f881e98def"},"outputs":[]} – ImFarhad Apr 29 '21 at 09:12
  • 1
    I got the mistake. I was not pre-pending Key word to my app's key. so it will be as follows: const metadata = new grpc.Metadata(); metadata.set("Authorization", "Key YOUR_APP_KEY"); – ImFarhad Apr 29 '21 at 09:37