{"action":"created","issue":{"url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/5","labels_url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/5/comments","events_url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/5/events","html_url":"https://github.com/bandwidthcom/node-bandwidth/issues/5","id":66872236,"number":5,"title":"Improving efficiency and consistency of Message.create ","user":{"login":"EdHintz","id":1288751,"avatar_url":"https://avatars.githubusercontent.com/u/1288751?v=3","gravatar_id":"","url":"https://api.github.com/users/EdHintz","html_url":"https://github.com/EdHintz","followers_url":"https://api.github.com/users/EdHintz/followers","following_url":"https://api.github.com/users/EdHintz/following{/other_user}","gists_url":"https://api.github.com/users/EdHintz/gists{/gist_id}","starred_url":"https://api.github.com/users/EdHintz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdHintz/subscriptions","organizations_url":"https://api.github.com/users/EdHintz/orgs","repos_url":"https://api.github.com/users/EdHintz/repos","events_url":"https://api.github.com/users/EdHintz/events{/privacy}","received_events_url":"https://api.github.com/users/EdHintz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T12:37:14Z","updated_at":"2015-04-13T15:19:38Z","closed_at":null,"body":"**Message.create** has different behavior and return results depending on whether one message or a list of messages is passed to the function.    \r\n\r\nWhen you call **Message.create** with a list of messages the callback for success is an array of objects containing the id of the message if that message was successfully sent, otherwise it is the error for that given message.  If the caller wants more details about a particular message that was sent, they call **Message.get** and pass in the id.\r\n\r\nWhen you call **Message.create** with a single message it behaves differently.\r\n\r\n**Expected**: An array of one object that contains the id of the message or the error if it failed.  If I want more details about the message (which I generally do not need) I can call **Message.get** with the id.\r\n\r\n**Actual**: Single object with details about the message sent.  This makes processing the result more complex than it needs to be.  If I always get an array even if it is an array of 1 for a single message I can process the results the same regardless of the number of messages sent.  Moreover, **Message.create** when passed a single message internally calls **Message.get** with the id of the message (this does not happen if you pass a list of messages).  This means the package makes an extra REST call back to the Bandwidth Application Server that I did not ask for and may not need.   We send a large number of single messages that results in twice as many REST calls to the Bandwidth Application Server than necessary.\r\n\r\nAs a user of node-bandwidth, I'd like the same structure sent to the call back of **Message.create** so that processing the result is simpler.\r\n\r\nAs a user of node-bandwidth, I'd like Message.create to not call Message.get internally to avoid an unnecessary REST call to the Bandwidth Application Server.  If I need the message details, I can call **Message.get** explicitly. \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/comments/92398722","html_url":"https://github.com/bandwidthcom/node-bandwidth/issues/5#issuecomment-92398722","issue_url":"https://api.github.com/repos/bandwidthcom/node-bandwidth/issues/5","id":92398722,"user":{"login":"wtcross","id":1154807,"avatar_url":"https://avatars.githubusercontent.com/u/1154807?v=3","gravatar_id":"","url":"https://api.github.com/users/wtcross","html_url":"https://github.com/wtcross","followers_url":"https://api.github.com/users/wtcross/followers","following_url":"https://api.github.com/users/wtcross/following{/other_user}","gists_url":"https://api.github.com/users/wtcross/gists{/gist_id}","starred_url":"https://api.github.com/users/wtcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wtcross/subscriptions","organizations_url":"https://api.github.com/users/wtcross/orgs","repos_url":"https://api.github.com/users/wtcross/repos","events_url":"https://api.github.com/users/wtcross/events{/privacy}","received_events_url":"https://api.github.com/users/wtcross/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T15:19:38Z","updated_at":"2015-04-13T15:19:38Z","body":"The API is already uniform. No reason for this requirement that all SDKs have the exact same interface, in my opinion. The purpose of an SDK should be to increase developer productivity for a specific language. That means using that languages practices, conventions, and patterns. If that isn't done the project is at risk for 0 contributions from \"real\" public people."}}