What does the "Failed to download" error mean when importing an API into SwaggerHub? - swaggerhub

I'm trying to import my OpenAPI JSON file, http://...../swagger/v2/swagger.json, into SwaggerHub but the import fails with this error:
The "Show Details" link shows:
Details:
Status: 403
I don't know where the error comes from because the URL is correct. What should I do to successfully import the API?

Related

403 IAM permission 'dialogflow.intents.list' on 'projects/None/agent' denied

import os
from fastapi import Request
from dotenv import load_dotenv
project_id = os.getenv('project_id')
import google.cloud.dialogflow_v2 as dialogflow
intents_client = dialogflow.IntentsClient()
parent = dialogflow.AgentsClient.agent_path(project_id)
I am trying to get the "intent list" / "entity list" but dialogflow does not response instead this message was showed
"403 IAM permission 'dialogflow.intents.list' on 'projects/None/agent' denied"
The problem here is that you can not use the dialogflow api in the local host. You will need to make it live with ngrok and then this will work. It will give all sorts of error on the local host.

Failed to execute 'replaceState' on 'History

I'm sending an exported file of codelab from the server-side to the client-side (React) where I embed it in the iframe. Interface showing correctly but I'm getting these errors in the console
Failed to execute 'replaceState' on 'History
Uncaught DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://localhost:3000/#3' cannot be created in a document with origin 'http://localhost:3000' and URL 'about:srcdoc'.
at W.ca (https://storage.googleapis.com/codelab-elements/codelab-elements.js:254:283)
at Sc (https://storage.googleapis.com/codelab-elements/codelab-elements.js:260:26)
at W.attributeChangedCallback (https://storage.googleapis.com/codelab-elements/codelab-elements.js:249:320)
at Qc (https://storage.googleapis.com/codelab-elements/codelab-elements.js:264:156)
at W.connectedCallback (https://storage.googleapis.com/codelab-elements/codelab-elements.js:247:50)
at W.attributeChangedCallback (https://storage.googleapis.com/codelab-elements/codelab-elements.js:249:152)
at CustomElementRegistry.define (https://storage.googleapis.com/codelab-elements/native-shim.js:150:18)
at https://storage.googleapis.com/codelab-elements/codelab-elements.js:264:634
at https://storage.googleapis.com/codelab-elements/codelab-elements.js:264:715
Also whenever I select the content module it doesn't show the selected module content. Instead this error show in console:
Uncaught TypeError: Failed to construct 'URL': Invalid base URL
at G.<anonymous> (codelab-elements.js:251:342)
at sb (codelab-elements.js:208:235)
at HTMLDivElement.ob (codelab-elements.js:210:22)
at HTMLDivElement.b (codelab-elements.js:205:50)
Currently, I'm using react on the client-side and node js on the server-side.
NodeJs Code:
Node Js code
React Code:
React Code

python slack API missing scope error despite appropriate scope for the bot token

I am trying to create a Slack API + Python web hook. I have setup the app and the bot tokens with the proper scope needed to create DM's with users and post messages. I am trying a sample script that will open channel.
import sys
import logging
logging.basicConfig(level=logging.DEBUG)
from slack_sdk import WebClient
slack_token = "xoxb-<random_value>"
client = WebClient(token=slack_token)
api_response = client.conversations_open(channel="user1")
I get an error response from the API:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.open)
The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'channels:write,groups:write,mpim:write,im:write', 'provided': 'incoming-webhook'}
Can someone please help ? For some reason, it identifies only the incoming-webhook. First time doing this. Any help appreciated

Python requests.put() is giving error: Invalid API call, Wrong method or URL

I have been trying to do a put request via BambooHR api to add a time off request. But it gives 404 and the header gives "Invalid API call, Wrong method or URL"
I couldn't understand what's wrong with my code. Add a time off request from Bamboo HR documentation is /api/gateway.php/{company}/v1/employees/{employee id}/time_off/request/ Sample: PUT /api/gateway.php/test/v1/employees/1/time_off/request/
import requests
url = 'https://api.bamboohr.com/api/gateway.php/johnsnowlabs/v1/employees/96/time_off/requests/?status=requested'
response1= requests.put(url, auth=('68d4165c9262fcf2302745a6d791b23dsfsd4107','John11')
print(response1.status_code)
it gives 404 and when response1.headers then the error message says Invalid API call, Wrong method or URL
I tried different combination of inputs in url but none seems to be working. However, all the GET requests are working, it's only the PUT one is not working.

Google Speech to text: The video model is currently not supported for language : nl-NL

Url used: https://cloud.google.com/speech-to-text/
I uploaded a wav audio file (exported both as mp3/wav/flac) via audacity.
I Selected "nederlands" (dutch), punctiation can be both on or of and uploaded the export.
First it uploads, gives me the 'transcribing' message and after that:
The video model is currently not supported for language : nl-NL
I see in the console of my browser window:
Failed to load resource: the server responded with a status of 400 ()
speech.min.js:1132 {
"error": {
"code": 400,
"message": "Invalid recognition 'config': The video model is currently not supported for language : nl-NL.",
"status": "INVALID_ARGUMENT"
}
}
cxl-services.appspot.com/proxy?url=https%3A%2F%2Fspeech.googleapis.com%2Fv1p1beta1%2Fspeech%3Arecognize Failed to load resource: the server responded with a status of 500 ()
speech.min.js:1132 A server error occurred!
If I use the microphone to record a message it works properly.
What am I doing wrong?
The speech-to-text API provides four different models to choose from:
video
phone_call
command_and_search
default
(https://cloud.google.com/speech-to-text/docs/basics#select-model)
Not all models are available for all languages. Try using the default model for fr-FR or nl-NL.
I had the same issue with de-DE. It wouldn't work with the video model, but using the default model worked.

Resources