# Cannot send to Slack for a workflow (but not the others)

**URL:** <https://discuss.bitrise.io/t/cannot-send-to-slack-for-a-workflow-but-not-the-others/12524>\
**Category:** Question & Answer\
**Created:** [April 5, 2020, 2:42am UTC](https://discuss.bitrise.io/t/cannot-send-to-slack-for-a-workflow-but-not-the-others/12524 "2020-04-05T02:42:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bawenang\_r](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bawenang_r/32/3568_2.png) [@bawenang\_r](https://discuss.bitrise.io/u/bawenang_r)\
**Post date:** [April 5, 2020, 2:42am UTC](https://discuss.bitrise.io/t/cannot-send-to-slack-for-a-workflow-but-not-the-others/12524/1 "2020-04-05T02:42:11Z")

</div>

Hi,  
I’ve got 4 workflows and all of them will send to slack at the end. All works except one of them.

It always returned this error: \*\*Error: Both API Token and WebhookURL are empty. You need to provide one of them. If you want to use incoming webhooks provide the webhook url. If you want to use a bot to send a message provide the bot API token  
\*\*

When I take a look at the others, I found the settings are similar except for the text to be sent. Here’s the slack settings of the failed workflow in the bitrise.yml.

```
- slack@3.1.3:
    inputs:
    - text: 'QA test and build successful! Build number: #${BITRISE_BUILD_NUMBER}'
    - text_on_error: 'QA test and build failed! Build number: #${BITRISE_BUILD_NUMBER}'
    - fields: |
        App|${BITRISE_APP_TITLE}
        Branch|${BITRISE_GIT_BRANCH}
        Commit|${GIT_CLONE_COMMIT_MESSAGE_SUBJECT} (${GIT_CLONE_COMMIT_HASH})
        Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
    - webhook_url: "$SLACK_WEBHOOK_URL_IOS"

```

I tried to change it to use API token instead of webhook like this but it still failed.

```
- slack@3.1.3:
    inputs:
    - text: 'QA test and build successful! Build number: #${BITRISE_BUILD_NUMBER}'
    - text_on_error: 'QA test and build failed! Build number: #${BITRISE_BUILD_NUMBER}'
    - fields: |
        App|${BITRISE_APP_TITLE}
        Branch|${BITRISE_GIT_BRANCH}
        Commit|${GIT_CLONE_COMMIT_MESSAGE_SUBJECT} (${GIT_CLONE_COMMIT_HASH})
        Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
    - api_token: "$SLACK_API_TOKEN"
    - channel: "#kolabree-build-ios"
    - webhook_url: ''

```

Here are the settings of the successful ones:

```
- slack@3.1.3:
    inputs:
    - text: 'Branch "${BITRISE_GIT_BRANCH}" test successful! Build number: #${BITRISE_BUILD_NUMBER}'
    - emoji: ''
    - text_on_error: 'Branch "${BITRISE_GIT_BRANCH}" test failed! Build number:
        #${BITRISE_BUILD_NUMBER}'
    - fields: "App|${BITRISE_APP_TITLE}\nBranch|${BITRISE_GIT_BRANCH} \nCommit|${GIT_CLONE_COMMIT_MESSAGE_SUBJECT}
        (${GIT_CLONE_COMMIT_HASH})\nWorkflow|${BITRISE_TRIGGERED_WORKFLOW_ID}\n"
    - webhook_url: "$SLACK_WEBHOOK_URL_IOS"

- slack@3.1.3:
    inputs:
    - text: 'Beta (Testflight) test and build successful! Build number: #${BITRISE_BUILD_NUMBER}'
    - text_on_error: 'Beta (Testflight) test and build failed! Build number: #${BITRISE_BUILD_NUMBER}'
    - fields: |
        App|${BITRISE_APP_TITLE}
        Branch|${BITRISE_GIT_BRANCH}
        Commit|${GIT_CLONE_COMMIT_MESSAGE_SUBJECT} (${GIT_CLONE_COMMIT_HASH})
        Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
    - webhook_url: "$SLACK_WEBHOOK_URL"

```

Where did I do wrong here? How do I fix this?

Thanks.

---

<div class="post-metadata">

**Author:** ![bawenang\_r](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bawenang_r/32/3568_2.png) [@bawenang\_r](https://discuss.bitrise.io/u/bawenang_r)\
**Post date:** [April 5, 2020, 10:45pm UTC](https://discuss.bitrise.io/t/cannot-send-to-slack-for-a-workflow-but-not-the-others/12524/2 "2020-04-05T22:45:27Z")

</div>

It turns out, I haven’t exposed the “$SLACK\_WEBHOOK\_URL” and “$SLACK\_WEBHOOK\_URL\_IOS” secret key to pull reqs. It worked now.

Thanks anyway…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [May 5, 2020, 10:45pm UTC](https://discuss.bitrise.io/t/cannot-send-to-slack-for-a-workflow-but-not-the-others/12524/3 "2020-05-05T22:45:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
