jones2026 / drone-flowdock

Drone plugin to push messages to flowdock
MIT License
0 stars 2 forks source link

flowdoc api returned: 404 Not Found #17

Open alin-simionoiuDE opened 4 years ago

alin-simionoiuDE commented 4 years ago

what am i doing wrong here?

  - name: Report Failure in Flowdoc
    image: jones2026/drone-flowdock
    settings:
      message: ":red_circle: Drone Build Failed :point_right: ${DRONE_BUILD_LINK}"
      flow_token: a30f9d
    when:
      status:
        - failure

obviously the flow_token there is not the actual token and i'm not using from_secret

the error i see in drone is Failed to post message, flowdock api returned: 404 Not Found

jones2026 commented 4 years ago

@alins did you follow these steps (https://github.com/jones2026/drone-flowdock/blob/master/docs/flowdock-setup.md) to create the token?

alin-simionoiuDE commented 4 years ago

yap, pretty sure that token works. tried it is a jenkins job i have around and everything seems to check out.

was wondering if the way I have configured the token using flow_token: a30f9d is causing the problem?

jones2026 commented 4 years ago

The token the Jenkins plugin uses is different from the one this plugin uses. Flowdock has labeled the type of token Jenkins uses as deprecated and that is why I opted to use the new one. https://www.flowdock.com/api/push

As for your syntax in your drone yaml everything looks good

alin-simionoiuDE commented 4 years ago

done another test: curl -XPOST https://api.flowdock.com/v1/messages/chat/a30f9d -d@flow.json where flow.json content is

{
  "content": "test",
  "external_user_name": "drone"
}

and it worked!

jones2026 commented 4 years ago

That endpoint is the deprecated one: https://www.flowdock.com/api/chat

Here is the replacement API flowdock suggests and the one this plugin uses: https://www.flowdock.com/api/messages

alin-simionoiuDE commented 4 years ago

got it. executed all the steps in those instructions and i got my new token. trying it now

alin-simionoiuDE commented 4 years ago

worked!!!. totally my bad on this one. really appreciate all your help here.

honestly is very confusing about the different api's and their tokens. it never occurred to me that there are two different token generators...one for the old style and to be deprecated api and a new one

jones2026 commented 4 years ago

No worries always glad to help!

Do you think a better error message might help instead of just the 404 response?

alin-simionoiuDE commented 4 years ago

yes please. something along the lines of "your token is either invalid or has been generated to be used for the deprecated apis. make sure you have generated the token using "...something like that