API

除了通过网页操作,你也可以通过我们的 api 来构建工作流,这可以极大简化你的工作流自动化进程。

GEThttps://api.protium.space/v1/workflow

List all workflow

This endpoint allows you to retrieve a paginated list of all your contacts. By default, a maximum of ten contacts are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of contacts returned.

Request

GET
/v1/contacts
curl -G https://api.protocol.chat/v1/contacts \
  -H "Authorization: Bearer {token}" \
  -d active=true \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "WAz8eIbvDR60rouK",
      "username": "FrankMcCallister",
      "phone_number": "1-800-759-3000",
      "avatar_url": "https://assets.protocol.chat/avatars/frank.jpg",
      "display_name": null,
      "conversation_id": "xgQQXg3hrtjh7AvZ",
      "last_active_at": 705103200,
      "created_at": 692233200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POSThttps://api.protium.space/v1/workflow

Create a workflow

This endpoint allows you to add a new workflow in protium. To add a workflow, you must provide your AccessToken and the workflow file.

Required attributes

  • Name
    token
    Type
    string
    Description

    The username for the contact.

  • Name
    workflow
    Type
    object
    Description

    The JSON file path of the workflow content, about how to setup a workflow, please see part 2.

Optional attributes

  • Name
    run
    Type
    boolean
    Description

    Choose whether run the workflow or not, default is False

Request

POST
/v1/workflow
curl https://api.protium.space/v1/contacts \
  -H "Authorization: Bearer {token}" \
  -d username="FrankMcCallister" \
  -d phone_number="1-800-759-3000" \
  -d avatar_url="https://assets.protocol.chat/avatars/frank.jpg"

Response

{
  "id": "WAz8eIbvDR60rouK",
  "username": "FrankMcCallister",
  "phone_number": "1-800-759-3000",
  "avatar_url": "https://assets.protocol.chat/avatars/frank.jpg",
  "display_name": null,
  "conversation_id": "xgQQXg3hrtjh7AvZ",
  "last_active_at": null,
  "created_at": 692233200
}

Was this page helpful?