Jump to content
hubinator

How to get chat messages using API?

Recommended Posts

Hey there! 

I don't have any knowledge in this, but @Dan created a topic on this on our sister-site Stake.com so I just copy-pasted it here. I hope it will help. :) 

And if this is not it actually, I hope Dan will be willing to explain. :) 

Take care! :) 

Examples

Send Message Mutation (sends a message to a chat channel)  [Authenticated]

mutation {
  sendMessage(chatId: "chat_id_goes_here", message: "message_goes_here") {
    id
    user {
      name
    }
  }
}

 

 

Public Chats Query (search for all public chat channels) [Unrestricted]

query {
  publicChats {
    id
    name
  }
}

Bet List Query (lookup a players bet history)  [Unrestricted]

{
  user(name: "dan") {
    betList(limit: 50, offset: 0) {
      iid
      game
      payout
      amountMultiplier
      payoutMultiplier
      amount
      currency
      createdAt
    }
  }
}

Roll Dice (play stakes dice game) [Authenticated]

mutation {
  diceRoll (amount: 1, target: 50, condition: above, currency: doge) {
    iid
    payout
    currency
    game
    nonce
  }
}

 

Share this post


Link to post
Share on other sites

It works. Thanks a lot Katarina.

If somebody got "Your API key doesn't have the permission to do this." then remove access token from headers. Adding access token to Unrestricted call causes this error.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×