web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / HTTP Request status co...
Copilot Studio
Unanswered

HTTP Request status code not returned

(0) ShareShare
ReportReport
Posted on by 6

I have a topic in AI Copilot Studio that uses HTTP Request. IT is calling a simple service, is_timecode, that takes a single parameter string and returns a true or false boolean. Everything is working well except the status code. I have set the status code within the HTTP request to a variable, status_code, but it doesn't seem to be set except when there is an error code. I would like to validate the status code is set to 200 and then process the boolean value in the result. When I read through the documentation Perform HTTP requests - Microsoft Copilot Studio | Microsoft Learn it implies this status code is only returned for errors. I find that a very odd design.

Can you advise if I'm misunderstanding how the status code is meant to be used for HTTP Request? My sample YAML below. Also, my web service returns the status code in the following python code: 

    return jsonify(result), 200  # Return the JSONified response
kind: AdaptiveDialog
beginDialog:
  kind: OnRecognizedIntent
  id: main
  intent:
    triggerQueries:
      - Is {Timecode} a timecode?
      - I wonder if {Timecode} is a timecode.
      - "{Timecode} is it a timecode?"

  actions:
    - kind: SetVariable
      id: setVariable_Ir3szb
      variable: Topic.timecode_val
      value: 00:01:01:01

    - kind: HttpRequestAction
      id: NjzNn8
      method: Post
      headers:
        Content-Type: application/json

      body:
        kind: JsonRequestContent
        content: "={timecode: Topic.timecode_val}"

      errorHandling:
        kind: ContinueOnErrorBehavior
        statusCode: Topic.status_code
        errorResponseBody: Topic.status_response

      requestTimeoutInMilliseconds: 30000
      response: Topic.is_timecode
      responseSchema: Boolean
      responseHeaders: Topic.response_headers

    - kind: SendActivity
      id: sendActivity_v4VHN4
      activity: "{Topic.status_code}"

    - kind: SendActivity
      id: sendActivity_3GXuts
      activity: testing

    - kind: SendActivity
      id: sendActivity_reBrOd
      activity: "{Topic.is_timecode}"

    - kind: ConditionGroup
      id: conditionGroup_IBQejZ
      conditions:
        - id: conditionItem_yfhf0a
          condition: =Topic.status_code = 200
          actions:
            - kind: ConditionGroup
              id: conditionGroup_6wmHt9
              conditions:
                - id: conditionItem_cPZ866
                  condition: =Topic.is_timecode = true
                  actions:
                    - kind: SendActivity
                      id: sendActivity_Uf2gdD
                      activity: It is a timecode

              elseActions:
                - kind: SendActivity
                  id: sendActivity_LdAVhc
                  activity: It is not a timecode.

      elseActions:
        - kind: SendActivity
          id: sendActivity_bVzjdj
          activity: An error occurred.

    - kind: EndDialog
      id: fuQb7i

outputType:
  properties:
    is_timecode:
      displayName: is_timecode
      type: Boolean
Categories:
I have the same question (0)
  • FL-11100204-0 Profile Picture
    2 on at
    What I found is that StatusCode is only set when there is an error with the http request.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 265 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 240 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard