Skip to main content
Invokes an endpoint to execute a specific operation using the Rapida API.
For full setup and authentication options, see the Installation guide: /api-reference/introduction.

Parameters

connectionConfig
ConnectionConfig
required
Configuration for the client connection.
request
InvokeRequest
required

Usage

from rapida import (
    ConnectionConfig,
    EndpointDefinition,
    InvokeRequest,
    invoke,
    string_to_any,
)
from pprint import pprint
connection_config = ConnectionConfig.default_connection_config(
    ConnectionConfig.with_sdk("{your-rapida-api-key}")
)

argument_value = string_to_any("Hello how are you doing")
metadata_value = string_to_any("metadata_to_track")
option_value = string_to_any("4567898656789")

response = invoke(
    client_cfg=connection_config,
    request=InvokeRequest(
        endpoint=EndpointDefinition(endpointId=2223006263292198912),
        args={"can": argument_value},
        metadata={"test": metadata_value},
        options={"opts1": option_value},
    ),
)
pprint(response)

Response

code
int
Numeric status code for the operation.
success
boolean
Indicates whether the operation was successful.
error
Error
data
array
requestId
uint64
Unique ID for tracking the request.
timeTaken
uint64
Duration of the operation in milliseconds.
metrics
array
meta
object