Master branch API call create_direct returns "blank" channel details

It does not appear to be in the documentation. Looking at the JavaScript driver code, I guessed that it would be something like this:

curl -i -d '{"user_id":"..."}' -H 'Authorization: Bearer ...' https://.../api/v3/teams/.../channels/create_direct

The response I got is:

HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
Content-Type: application/json
X-Ratelimit-Limit: 10
X-Ratelimit-Remaining: 9
X-Ratelimit-Reset: 1
X-Request-Id: 5ge6iuzj17r45mn1htoniq4ayc
X-Version-Id: 3.3.0.b95a0e0868202e6adaa530ff8366460e
Date: Fri, 05 May 2017 14:31:25 GMT
Content-Length: 200
Via: 1.1 vegur


Is this a bug or am I doing something wrong?

I tried it again on a fresh Mattermost instance and the direct channel details were returned correctly the first time. It behaved as described above the succeeding times. I thought this might be a regression of an issue that’s been marked as fixed in master months ago. But then I thought to check exactly what version is being deployed by the Deploy to Heroku button in the README in the GitHub page. I saw that the link was deploying from a separate repo whose last commit was a few months before the fix. I suppose this means I really am running into the issue cited above. I think something needs to be there by that link that indicates it’s not deploying the repo it’s found on.

Hi @chrycheng,

I just tried this locally on latest master and it seems to be working fine for me:

curl -i -d '{"user_id": "fc3izce8338dtmw6ypsro1oo5c"}' -H 'Authorization: Bearer sessiontoken' http://localhost:8065/api/v3/teams/jfw19jcanbykbmj6bs5idhw3ca/channels/create_direct

The response I got was:

HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: d57666ekdirdbq9uonn59bp97c
Date: Wed, 17 May 2017 12:09:46 GMT
Content-Length: 317