Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    Getting StartedAdministrator documentationFunctional characteristics
      Technology descriptionarrow
    • Architecture OverviewComponent Description
        Deployment schemesarrow
      • Basic schemeFail-safe schemeTypical Placement in Infrastructure
    System requirements
      Admin Panelarrow
      • Account areaarrow
        • Accountsarrow
        • Account UsersAccount Virtual SendersAccount Database Indexes
        TariffsExternal data configurationLDAPTasksSchedule JobsGlobal Stop ListsWebversion Store Policies
        Settingsarrow
      • Databases
          Accessarrow
        • AdminsAPI tokens
        Notifiers
          MTAarrow
        • Default rulesRetry rulesLock rulesBounce patternsStrategiesKeysISPsPools
      Nodes
        Sendersarrow
      • EmailSMSEvent generatorIntegration with SendsayENS: настройка сендера
        Reportsarrow
      • Audit JournalData Usage
        Toolsarrow
      • ARF decoderURL decoderSMID decoderLicense
      Platform installationarrow
    • Automatic installationManual installationRunning the platform in a Docker container
      Platform configurationarrow
    • Configuration fileDomain settingsLDAP access configurationSending Email via SMTP relayPixel and push domain configurationCluster and Replication SetupSystem notifications configurationProcesses UNIX sockets configurationHTTPS ConfigurationMigrating from MongoDB Community Edition to Percona Server for MongoDBAdding sender IP addressesDeduplication request settingsPostgreSQL database for account dataProxy server settingsKeycloak Integration with AltcraftGetting HTTP service statusesConfiguration MongoDB logs rotation
        Configuration of system constants and directoriesarrow
      • Filtering bot actionsDirectory of gender markers
      Platform maintenancearrow
    • Personnel requirementsPlatform maintenance processesPlatform updatingPlatform service monitoringBackup and recoveryTransferring the platform to a new serverCreating, deleting, and populating tables for statistics in ClickHouseUsage of the aktool utilityUsers and directories engaged by the platform
      Custom channels guidearrow
    • OverviewCreating and configuring a channelEntity field configurationTemplate languageEntities
        Pipesarrow
      • Pipe: Basic ConceptsResultErrorsLogPackUnpackHTTP RequestStore SetStore GetSelectorSQLEventerScheduler
        Pipelinesarrow
      • Pipeline: Basic ConceptsMessageScheduleListenerModerateStop
      Extraarrow
    • System page customizationSend Message IDИнструкция по миграции истории в ClickHouseInstructions for migrating history to ClickHouseUtility for importing push subscriptions to Firebase projectUtility for importing push subscriptions to Firebase project
    Processing HTTP/HTTPS traffic
      Administrator APIarrow
      • Accounts admin apiarrow
        • Restricted accessarrow
        • Account Activation and DeactivationAccount Freeze and Unfreeze
        Get accounts listAdd a new accountDelete the account
        Account usersarrow
      • Update an Existing AccountAdd a new accountDelete a userGet a list of usersSending a Welcome Email
        Nodesarrow
      • Synchronize node MTA configurationGet nodes listGet node MTA statusActivate node MTADeactivate node MTA
        Senders admin apiarrow
      • Create or update AKMTA senderGet AKMTA sender informationAssign account to senderGet senders listDelete senderRestore sender
          Sender queuearrow
        • Get sender queue informationHold sender queueRelease sender queueClear sender queue
        Virtual sendersarrow
      • Get virtual senders listGet virtual sender informationCreate virtual senderUpdate virtual senderClone virtual senderDelete virtual sender
    Documentation Archive
  • Custom channels guide
  • Pipes
  • HTTP Request

HTTP Request

Description​

Http request pipe performs an http request.

Peculiarities:

Depending on prams.content_type:

  • form, form-data – data is expected in params.form;
  • xml, json – data is expected in $in.body (must be a byte array).

Structure​

FieldType of valueExampleRequiredDescription
idnumber10yesPipe's ID
typestring"http_request"yesType of a pipe
paramsHttpParamsObject
yesType-specific parameters
outsOutsObject
noPipe's outputs

HttpParamsObject
FiеldTypeExampleRequiredDefaultDescription
content_typestring"json"no"form"

Possible values:

  • form – URL GET parameter
  • form-data – multipart/form-data
  • xml
  • json
methodstringп"POST"no"GET"

Possible values:

  • GET
  • POST
  • DELETE
  • PUT
auth_typestring"basic"no"basic"

Possible values:

  • basic

Will be enabled if specified auth_username.


Requires auth_username and auth_password .


Sets a title Authorization: Basic <username>:<password>

auth_usernamestringа"root"no""Login for basic authorization
auth_passwordstring"1234"no""Password for basic authorization
url

string

"http://exmaple.com/send"no""URL
timeoutтгьиук20тщ

PIPE_HTTP_TIMEOUT


in the configuration file

Timeout in seconds for http request.
success_codesarray of numbers[200, 201]no[200, 201, 202, 203, 204, 205, 206, 207, 208]

An array of http codes, if one of them is present, the event will be sent to outs.success exit.

pool_sizenumber10no

PIPE_HTTP_MAX_CONN


in the configuration file

Limiting the connection pool to one host within a channel.

Increasing pool_size may not bring the desired speed increase without increasing the PIPE_WORKER_SIZE parameter in the configuration file

limitLimitObject

{


   "period_sec": 60,


   "count_requests": 30,


   "key": "some key"


}

no-

Limiting the request rate.

tip

The default request rate depends on the pipeline configuration, but is approximately 200 - 300 requests per second.

headers

object

{


   "someHeader": "value"


}

no-Request headers
form

object

{


   "test": "123"


}

no-

A key:value object that specifies the form for the content_type form and form-data


LimitObject
FiеldTypeExampleRequiredDefaultDescription
period_secnumber1yes-Range in seconds
count_requestsnumber2yes-

The allowed number of requests in the specified time range for the selected key.

The limit is valid within the limits of key in the channel

key

string

"$resource.token"norandom uuid

Constraint ID. Can be a constant or a template.

Needed to set one restriction on several http_request pipes

Errors​

  1. Errors in field template processing.
  2. $in.body not found (missing pack pipe).

  3. $in.body not a byte array.

  4. params.content_type not valid.

  5. params.method not valid.

  6. http request error.

Examples​

  1. Example request with form.
{
"id": 3,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "FORM",
"form": {
"login": "$sender.login",
"password": "$sender.password",
"externalUserCode": "$sender.login"
},
"url": "https://example.com/api/v1.0/sessions",
"success_codes": [200, 202]
},
"outs": {
"success": 6,
"error": 7
}
}
  1. Example request with JSON. It is assumed that in the chain before the pipe there is a pack pipe that generates JSON.
{
"id": 2,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "JSON",
"headers": {
"Authorization": "$in.ow_tp $in.ow_token"
},
"url": "https://example.com/api/v1/api/campaign/start",
"success_codes": [200, 202]
},
"outs": {
"success": 9,
"error": 10
}
}
Last updated on Nov 13, 2023
Previous
Unpack
Next
Store Set
  • Description
  • Structure
  • Errors
  • Examples
© 2015 - 2026 Altcraft, LLC. All rights reserved.