Documentation ¶
Overview ¶
This is the workflow action for calling an api
Index ¶
Constants ¶
View Source
const ( BODY_DATA_TYPE_FORM_DATA = "form-data" BODY_DATA_TYPE_NONE = "none" BODY_DATA_TYPE_RAW = "raw" BODY_DATA_TYPE_BINARY = "binary" BODY_DATA_TYPE_X_WWW_FORM_URLENCODED = "x-www-form-urlencoded" )
Constants for the body data type
Variables ¶
This section is empty.
Functions ¶
func Action_CallApi ¶
func Action_CallApi(w *workflow.Workflow, m *workflow.TemplateData) error
CallApi is the main function for the action
- action: api description: "This is an example of calling an API POST request." config: method: POST url: https://gorest.co.in/public/v2/users body_type: raw body: | {"name":"Agent Smith", "gender":"male", "email":"agent.smith@15ce.com", "status":"active"} header_Content-Type: application/json header_Authorization: "Bearer {{get_param `token`}}" result_action: "js" result_js: | function ActionResults(m,result){ var obj=JSON.parse(result); store_value("api_result","user_id",obj.id); console(result); return true; }
func GetSchema ¶
func GetSchema() workflow.SchemaEndpoint
GetAction returns the action for the target
Types ¶
type ApiSchema ¶
type ApiSchema struct { }
func (ApiSchema) GetActionSchema ¶
func (s ApiSchema) GetActionSchema() map[string]workflow.ActionSchema
GetActions returns the actions for this schema
func (ApiSchema) GetFunctionMap ¶
func (s ApiSchema) GetFunctionMap() map[string]workflow.FunctionSchema
GetFunctionMap returns the function map for this schema
func (ApiSchema) GetTargetSchema ¶
func (s ApiSchema) GetTargetSchema() map[string]workflow.TargetSchema
GetTargetSchema returns the target schema for this action
Click to show internal directories.
Click to hide internal directories.