Sending int rather than string

This commit is contained in:
itzaname 2017-01-08 01:32:13 -05:00
parent df35140c0a
commit dbd1a46349

View File

@ -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 {