Knowledge Center next icon Getting data over HTTP
Apr 21, 2023
1 minute read

Getting data over HTTP

Sometimes you may want to use data from an external system within a script. This can be done by doing a HTTP request to the external system and extract data from the response.

config:  conversationOwner: null  conversationOwners:    - identifier: conversationOwner      channel: WhatsApp  scriptLanguageVersion: 1  scriptVersion: 1  defaultDelay: 200  lists:    positive-answers:      items:        - Ja    negative-answers:      source: negative-answers.ymlflows:  - id: main    description: Entry flow for the bot    steps:      - !entry         id: Entry-1        actions: []        clientActions: []        matches:          - opening        allowRestart: true        isCaseSensitive: true        doCatchAll: true      - !webrequest         id: WebRequest-1        actions: []        clientActions: []        retries: 0        retryDelay: 0        waitForResponse: true        request:          queryParameters: {}          headers: {}          url: https://webrequeststep.free.beeceptor.com/todos          method: GET          timeout: 60          body: ''        response:          extracts:            - var: firstTodoId              source: '@body.json'              selector: '[0].id'            - var: firstTodoTitle              source: '@body.json'              selector: '[0].title'      - !text         id: Text-1        actions: []        clientActions: []        message: >-          The first todo in the response has id {firstTodoId} and its title is          "{firstTodoTitle}".

The URL used here is generated by https://beeceptor.com/console/webrequeststep. Keep in mind this is a public URL viewable by everyone.

group icon
Get support

Can’t find the answer you are looking for?
Ask for the help of our chatbot, or get in touch with our support team.

Contact Support
Is this region a better fit for you?
Go
close icon