Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Unanswered

Trying to follow the tutorial to create a basic custom connector

(0) ShareShare
ReportReport
Posted on by 2,278

I'm just trying to follow the tutorial to learn how to create a custom connector here.

 

This is my Swagger code for the custom connector, after completing the tutorial and validating the connector:

 

 

 

swagger: '2.0'
info:
 title: SentimentDemo
 description: Demo sentiment analytics da API Azure cognitive services
 version: '1.0'
host: westus.api.cognitive.microsoft.com
basePath: /
schemes:
 - https
consumes: []
produces: []
paths:
 /text/analytics/v2.0/sentiment:
 post:
 responses:
 default:
 description: default
 schema:
 type: object
 properties:
 documents:
 type: array
 items:
 type: object
 properties:
 score:
 type: integer
 format: int32
 description: score
 id:
 type: string
 description: id
 description: documents
 errors:
 type: array
 items:
 type: object
 properties:
 id:
 type: string
 description: id
 message:
 type: string
 description: message
 description: errors
 summary: Returns a numeric score representing the sentiment detected
 description: >-
 The API returns a numeric score between 0 and 1. Scores close to 1
 indicate positive sentiment, while scores close to 0 indicate negative
 sentiment.
 operationId: DetectSentiment
 parameters:
 - name: body
 in: body
 required: false
 schema:
 type: object
 properties:
 documents:
 type: array
 items:
 type: object
 properties:
 language:
 type: string
 description: The 2 or 4 character language code for the text
 title: Language
 default: en
 id:
 type: string
 description: An identifier for each document that you submit
 title: ID
 format: ''
 text:
 type: string
 description: The text to analyze for sentiment
 title: Text
 default: None
 required:
 - id
 - language
 - text
 description: documents
 required:
 - documents
definitions: {}
parameters: {}
responses: {}
securityDefinitions:
 API Key:
 type: apiKey
 in: header
 name: Ocp-Apim-Subscription-Key
security:
 - API Key: []
tags: []

 

 

 

Everything is fine, but it doesn't work, when it comes to testing it.

 

These are the API keys I got from Azure:

 

WebPortal_0-1676031030423.png

 

 

I've tried both several times, but it doesn't matter. I always get the error:

 

Status
Unauthorized (401)
Headers
 

 

{
 "apim-request-id": "d68202be-664d-44c4-87c7-663acd8d5f89",
 "content-length": "224",
 "content-type": "application/json",
 "date": "Fri, 10 Feb 2023 12:07:13 GMT",
 "x-ms-apihub-cached-response": "true",
 "x-ms-apihub-obo": "false"
}

 

 
Body
 
 

 

{
 "error": {
 "code": "401",
 "message": "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."
 }
}

 

 

  • WebPortal Profile Picture
    2,278 on at
    Re: Trying to follow the tutorial to create a basic custom connector

    @Sundeep_Malik 

     

    Sorry, Where should I write the key?

     

    WebPortal_0-1676039860682.png

     

     

    Or here somewhere?

    WebPortal_1-1676039886061.png

     

     

  • Sundeep_Malik Profile Picture
    6,480 on at
    Re: Trying to follow the tutorial to create a basic custom connector

    Hey @WebPortal 

     

    In the headers pass:

     

    "Ocp-Apim-Subscription-Key": "Your Key"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492

Featured topics