• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

HTTP GET and POST

Learn how to make HTTP requests in workflows to interact with REST APIs and external services.

Requirements:

  • Target API endpoint URLs
  • Any required authentication credentials (API keys, tokens, etc.)
  • Understanding of the API request/response formats

Fetch and process data

Fetch data from REST API endpoints. Headers and URL parameters must be stringified JSON.

What this workflow does:

  • Perform HTTP GET call to retrieve data from an API endpoint

  • Use selectors to extract status code and response data

  • Log API response status to New Relic

    name: http_get_example
    workflowInputs:
    apiUrl:
    type: String
    defaultValue: 'https://api.example.com/data'
    steps:
    - name: fetchData
    type: action
    action: http.get
    version: 1
    inputs:
    url: ${{ .workflowInputs.apiUrl }}
    headers: '{"Authorization": "Bearer ${{ :secrets:api_token }}"}'
    urlParams: '{"filter": "active", "limit": "10"}'
    selectors:
    - name: status
    expression: .statusCode
    - name: data
    expression: .responseBody | fromjson
    - name: logResponse
    type: action
    action: newrelic.ingest.sendLogs
    version: 1
    inputs:
    logs:
    - message: 'API returned status: ${{ .steps.fetchData.outputs.status }}'
    attributes:
    responseData: ${{ .steps.fetchData.outputs.data }}

Key actions: http.get, newrelic.ingest.sendLogs

Send data to external systems

Send data to webhooks, APIs, or notification services. Headers must be stringified JSON, body must be a string.

What this workflow does:

  • Perform HTTP POST call to send data to an API endpoint

  • Use selectors to extract HTTP status and response

  • Log webhook response status to New Relic

    name: http_post_example
    workflowInputs:
    webhookUrl:
    type: String
    alertMessage:
    type: String
    steps:
    - name: sendNotification
    type: action
    action: http.post
    version: 1
    inputs:
    url: ${{ .workflowInputs.webhookUrl }}
    headers: '{"Content-Type": "application/json"}'
    body: '{"event": "alert_triggered", "message": "${{ .workflowInputs.alertMessage }}", "severity": "high"}'
    selectors:
    - name: httpStatus
    expression: .statusCode
    - name: response
    expression: .responseBody
    - name: logResult
    type: action
    action: newrelic.ingest.sendLogs
    version: 1
    inputs:
    logs:
    - message: 'Webhook returned status: ${{ .steps.sendNotification.outputs.httpStatus }}'

Common use cases:

  • Trigger deployments via CI/CD webhooks
  • Send data to ticketing systems (Jira, ServiceNow)
  • Post to custom notification services
  • Integrate with third-party APIs

Key actions: http.post, newrelic.ingest.sendLogs

What's next

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.