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-Cluster-Id:
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

{"id":"","create_at":0,"update_at":0,"delete_at":0,"team_id":"","type":"","display_name":"","name":"","header":"","purpose":"","last_post_at":0,"total_msg_count":0,"extra_update_at":0,"creator_id":""}

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-Cluster-Id: 
X-Request-Id: d57666ekdirdbq9uonn59bp97c
X-Version-Id: 3.9.0.dev.851d92ebc6f67bac3dac7c2e8487a5f2.false
Date: Wed, 17 May 2017 12:09:46 GMT
Content-Length: 317

{"id":"75sc7f8cu7f8pmj63rit99zdwy","create_at":1494880285514,"update_at":1494880285514,"delete_at":0,"team_id":"","type":"D","display_name":"","name":"dbcankcs7i8gi84s6a4iaatwee__fc3izce8338dtmw6ypsro1oo5c","header":"","purpose":"","last_post_at":0,"total_msg_count":0,"extra_update_at":1494880285514,"creator_id":""}