Skip to content

Feature/143 page mon compte add notification integration

CreateChannel

Working call:

$ curl -s -H "agent:9e82e551-ccee-489a-a4c8-81329e70a8a3" -H "api-key:f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -H "Content-Type: application/json" -XPOST 'http://localhost:7576/v1/organizations/kDtJz8EqQ0C7KgOF6qwxfg/channels' -d '{"parent": "organizations/kDtJz8EqQ0C7KgOF6qwxfg","channel": {"type": "email","parameters": {"dest": {"@type": "type.googleapis.com/google.protobuf.StringValue","value": "hello@pantomath.io"}}}}' | jq '.'
{
  "name": "organizations/kDtJz8EqQ0C7KgOF6qwxfg/channels/pqUMITn0Sx-j8q3-n8sDlQ",
  "type": "email",
  "parameters": {
    "dest": {
      "@type": "type.googleapis.com/google.protobuf.StringValue",
      "value": "hello@pantomath.io"
    }
  }
}

With inexistent channel type:

$ curl -s -H "agent:9e82e551-ccee-489a-a4c8-81329e70a8a3" -H "api-key:f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -H "Content-Type: application/json" -XPOST 'http://localhost:7576/v1/organizations/kDtJz8EqQ0C7KgOF6qwxfg/channels' -d '{"parent": "organizations/kDtJz8EqQ0C7KgOF6qwxfg","channel": {"type": "mel","parameters": {"dest": {"@type": "type.googleapis.com/google.protobuf.StringValue","value": "hello@pantomath.io"}}}}' | jq '.'
{
  "error": "Couldn't create channel",
  "code": 13
}

Without channel:

$ curl -s -H "agent:9e82e551-ccee-489a-a4c8-81329e70a8a3" -H "api-key:f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -H "Content-Type: application/json" -XPOST 'http://localhost:7576/v1/organizations/kDtJz8EqQ0C7KgOF6qwxfg/channels' -d '{"parent": "organizations/kDtJz8EqQ0C7KgOF6qwxfg"}' | jq '.'
{
  "error": "Missing channel.",
  "code": 3
}

ListChannelTypes

$ curl -s -H "agent:9e82e551-ccee-489a-a4c8-81329e70a8a3" -H "api-key:f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -H "Content-Type: application/json" -XGET 'http://localhost:7576/v1/channeltypes' | jq '.'
{
  "channeltypes": [
    {
      "name": "channeltypes/ZW1haWw",
      "label": "email",
      "parameters": {
        "cc": {
          "@type": "type.googleapis.com/google.protobuf.StringValue",
          "value": ""
        },
        "dest": {
          "@type": "type.googleapis.com/google.protobuf.StringValue",
          "value": ""
        }
      }
    },
    {
      "name": "channeltypes/c2xhY2s",
      "label": "slack",
      "parameters": {
        "cc": {
          "@type": "type.googleapis.com/google.protobuf.StringValue",
          "value": ""
        },
        "slack-key": {
          "@type": "type.googleapis.com/google.protobuf.StringValue",
          "value": ""
        }
      }
    }
  ],
  "next_page_token": "AAI"
}
Edited by Julien Andrieux

Merge request reports