Hello,
l am new to mattermost and l find it lovely.
l want to use REST API to send direct message to a user.
When there is a direct message already opened, or had been opened with that user,
REST API works.
curl -i -X POST -d ‘payload={“channel”: “@[USERID]”, “text”: “ [MESSAGE]”}’ http://[INCOMING WEBHOOK URL]
However, when there is no history of direct messaging with that user,
REST API failes with this return.
HTTP/1.1 307 Temporary Redirect
Content-Security-Policy: frame-ancestors ‘none’
Location: /error?title=Mattermost+needs+your+help%3A&message=Couldn%27t+find+the+channel&details=err%3Dstore.sql_channel.get_by_name.missing.app_error&link=%2F&linkmessage=Go+back+to+Mattermost
X-Frame-Options: DENY
X-Ratelimit-Limit: 100
X-Ratelimit-Remaining: 99
X-Ratelimit-Reset: 1
X-Request-Id: ymrzak8jefnsfexe7yqzpqzh7a
X-Version-Id: 3.0.0.1468997210
Date: Mon, 25 Jul 2016 08:22:31 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
ls it impossible to initiate a new direct message with REST API?
lf there is a way to do this, please let me know!
Thank you in advance.