Skip to content
Other protocols

Other protocols

Saved requests are HTTP. For other protocols apigent has one-shot commands that take the endpoint as an argument. They are not saved, recorded, or filled from environments.

GraphQL

apigent graphql https://api.example.com/graphql --query '{ users { name email } }'

apigent graphql https://api.example.com/graphql \
  --query 'query($limit: Int!) { users(limit: $limit) { name } }' \
  --vars '{"limit": 10}'

apigent graphql https://api.example.com/graphql --query-file queries/get-users.graphql --op GetUsers

To keep a GraphQL call with auth and environments, save it as an ordinary POST request with a JSON body ({"query": "...", "variables": {...}}) and run it with apigent run. Flags: apigent graphql.

gRPC

apigent grpc localhost:50051 --list                                    # services via reflection
apigent grpc localhost:50051 --service UserService --method GetUser --data '{"id": 1}'

TLS options: --cacert, --cert, --key, --server-name, or --insecure for testing. Flags: apigent grpc.

WebSocket

apigent ws wss://echo.example.com --send '{"type":"ping"}'     # send one message and exit
apigent ws wss://echo.example.com --pretty --timestamp         # interactive (stdin/stdout)

Flags: apigent ws.

Server-Sent Events

apigent sse https://api.example.com/events --event order.created --json

Flags: apigent sse.