From dbd1a46349360a9034cdab808f4d75d89aa2efc9 Mon Sep 17 00:00:00 2001 From: itzaname Date: Sun, 8 Jan 2017 01:32:13 -0500 Subject: [PATCH] Sending int rather than string --- message.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/message.go b/message.go index f2456c1..ac73d31 100644 --- a/message.go +++ b/message.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strconv" ) // Message structure for message data @@ -61,10 +62,14 @@ func (s *Session) GetInbox() ([]Message, error) { // SendMessage will send a message via post func (s *Session) SendMessage(subject string, body string, recipientid string) error { + reciever, err := strconv.Atoi(recipientid) + if err != nil { + return err + } payload := map[string]interface{}{ "subject": subject, "body": body, - "recipientId": recipientid, + "recipientId": reciever, } data, err := json.Marshal(&payload) if err != nil {