X (Twitter) · Arazzo Workflow

X Mute a User by Their Username

Version 1.0.0

Resolve a target handle to an id, then mute that user.

1 workflow 1 source API 1 provider
View Spec View on GitHub Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContentArazzoWorkflows

Provider

twitter

Workflows

mute-user-by-username
Resolve a username and mute that user as the authenticated account.
Chains the username lookup endpoint into the mute-user endpoint, using the resolved id as the mute target.
2 steps inputs: authUserId, authorization, targetUsername outputs: muting, targetUserId
1
resolveTarget
getUsersByUsername
Resolve the target username into a numeric user id.
2
muteTarget
muteUser
Mute the resolved target user as the authenticated user.

Source API Descriptions

Arazzo Workflow Specification

twitter-mute-user-by-username-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: X Mute a User by Their Username
  summary: Resolve a target handle to an id, then mute that user.
  description: >-
    Lets the authenticated user mute another account given only that account's
    public @username. The workflow resolves the username into a numeric user id
    and then issues the mute request, inlining the target_user_id in the mute
    body so the chain reads and executes without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: xApi
  url: ../openapi/x-api-openapi.json
  type: openapi
workflows:
- workflowId: mute-user-by-username
  summary: Resolve a username and mute that user as the authenticated account.
  description: >-
    Chains the username lookup endpoint into the mute-user endpoint, using the
    resolved id as the mute target.
  inputs:
    type: object
    required:
    - authUserId
    - targetUsername
    properties:
      authUserId:
        type: string
        description: The numeric id of the authenticated user who will mute.
      targetUsername:
        type: string
        description: The @username of the account to mute, without the leading @.
      authorization:
        type: string
        description: OAuth2 user token to authorize the requests (e.g. "Bearer xxx").
  steps:
  - stepId: resolveTarget
    description: Resolve the target username into a numeric user id.
    operationId: getUsersByUsername
    parameters:
    - name: username
      in: path
      value: $inputs.targetUsername
    - name: user.fields
      in: query
      value: id,name,username
    - name: Authorization
      in: header
      value: $inputs.authorization
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      targetUserId: $response.body#/data/id
  - stepId: muteTarget
    description: Mute the resolved target user as the authenticated user.
    operationId: muteUser
    parameters:
    - name: id
      in: path
      value: $inputs.authUserId
    - name: Authorization
      in: header
      value: $inputs.authorization
    requestBody:
      contentType: application/json
      payload:
        target_user_id: $steps.resolveTarget.outputs.targetUserId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      muting: $response.body#/data/muting
  outputs:
    targetUserId: $steps.resolveTarget.outputs.targetUserId
    muting: $steps.muteTarget.outputs.muting