petral20021 Posted January 26, 2022 #1 Posted January 26, 2022 Does anyone have an approved API list for DICE?
basbas Posted January 26, 2022 #2 Posted January 26, 2022 many people use that for challenge and impossible to find it anywhere
kingnayim2 Posted January 26, 2022 #3 Posted January 26, 2022 no official documentation for the api is available there were a few topics on the forum but only this one left there are useful information in this post for your question
petral20021 Posted January 26, 2022 Author #4 Posted January 26, 2022 3 hours ago, kingnayim2 said: no official documentation for the api is available there were a few topics on the forum but only this one left there are useful information in this post for your question the whole problem is that I don't know where to get the value of the Identifier key
dupeddonk Posted January 26, 2022 #5 Posted January 26, 2022 3 minutes ago, petral20021 said: the whole problem is that I don't know where to get the value of the Identifier key Just inspect the network calls in chrome dev tools.
petral20021 Posted January 26, 2022 Author #6 Posted January 26, 2022 1 hour ago, dupeddonk said: Just inspect the network calls in chrome dev tools. if you play manually, you can see everything in the inspector, and if using the API key, it gives an error
Moderator ROkenTratENsaV Posted January 26, 2022 Moderator #7 Posted January 26, 2022 14 minutes ago, petral20021 said: if you play manually, you can see everything in the inspector, and if using the API key, it gives an error Copy the graphql request it makes when you play from browsers network tab. Replace 'x-access-token' with your API key (headers). Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet
petral20021 Posted January 26, 2022 Author #8 Posted January 26, 2022 25 minutes ago, ROkenTratENsaV said: Copy the graphql request it makes when you play from browsers network tab. Replace 'x-access-token' with your API key (headers). Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet query: "mutation DiceRoll($amount: Float!, $target: Float!, $condition: CasinoGameDiceConditionEnum!, $currency: CurrencyEnum!, $identifier: String!) {\n diceRoll(\n amount: $amount\n target: $target\n condition: $condition\n currency: $currency\n identifier: $identifier\n ) {\n ...CasinoBet\n state {\n ...CasinoGameDice\n }\n }\n}\n\nfragment CasinoBet on CasinoBet {\n id\n active\n payoutMultiplier\n amountMultiplier\n amount\n payout\n updatedAt\n currency\n game\n user {\n id\n name\n }\n}\n\nfragment CasinoGameDice on CasinoGameDice {\n result\n target\n condition\n}\n" variables: {target: 50.5, condition: "above", identifier: "Rpw_fwf36OjBGdsR6VSp", amount: 0.00001,…} where can i find out the value of this variable "identifier"?
Moderator ROkenTratENsaV Posted January 26, 2022 Moderator #9 Posted January 26, 2022 1 hour ago, petral20021 said: query: "mutation DiceRoll($amount: Float!, $target: Float!, $condition: CasinoGameDiceConditionEnum!, $currency: CurrencyEnum!, $identifier: String!) {\n diceRoll(\n amount: $amount\n target: $target\n condition: $condition\n currency: $currency\n identifier: $identifier\n ) {\n ...CasinoBet\n state {\n ...CasinoGameDice\n }\n }\n}\n\nfragment CasinoBet on CasinoBet {\n id\n active\n payoutMultiplier\n amountMultiplier\n amount\n payout\n updatedAt\n currency\n game\n user {\n id\n name\n }\n}\n\nfragment CasinoGameDice on CasinoGameDice {\n result\n target\n condition\n}\n" variables: {target: 50.5, condition: "above", identifier: "Rpw_fwf36OjBGdsR6VSp", amount: 0.00001,…} where can i find out the value of this variable "identifier"? You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me.
dupeddonk Posted January 26, 2022 #10 Posted January 26, 2022 1 hour ago, ROkenTratENsaV said: You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me. You don't even need the identifier prop. You could get rid of it or make it an empty string and it still works. I think it acts sort of like a cookie to remember the last state of your browser - could be wrong though. 3 hours ago, ROkenTratENsaV said: Copy the graphql request it makes when you play from browsers network tab. Replace 'x-access-token' with your API key (headers). Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet If you're running the script it in your browser console you can also just call the api key from your local storage like this: const KEY = JSON.parse(localStorage.getItem("session")); ------ const HEADERS = {"content-type":"application/json","x-access-token":KEY }; ----- //then in the post request just put "headers": HEADERS, This way you can share the code and reuse it without ever having to touch your api key. Won't work if you're doing it from a separate terminal though.
petral20021 Posted January 27, 2022 Author #11 Posted January 27, 2022 8 hours ago, ROkenTratENsaV said: You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me. thanks, everything is good)
Moderator ROkenTratENsaV Posted January 27, 2022 Moderator #12 Posted January 27, 2022 8 hours ago, dupeddonk said: You don't even need the identifier prop. You could get rid of it or make it an empty string and it still works. I think it acts sort of like a cookie to remember the last state of your browser - could be wrong though. Probably yeah. 8 hours ago, dupeddonk said: If you're running the script it in your browser console you can also just call the api key from your local storage like this: const KEY = JSON.parse(localStorage.getItem("session")); ------ const HEADERS = {"content-type":"application/json","x-access-token":KEY }; ----- //then in the post request just put "headers": HEADERS, This way you can share the code and reuse it without ever having to touch your api key. Won't work if you're doing it from a separate terminal though. That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃
petral20021 Posted January 27, 2022 Author #13 Posted January 27, 2022 9 hours ago, ROkenTratENsaV said: Probably yeah. That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃 thanks for the help, I use JS)
petral20021 Posted January 28, 2022 Author #14 Posted January 28, 2022 22 hours ago, petral20021 said: thanks for the help, I use JS) Thanks everyone, I figured it out, I now have a complete API
Abekobeeee Posted January 7, 2023 #15 Posted January 7, 2023 On 1/27/2022 at 5:10 PM, ROkenTratENsaV said: Probably yeah. That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃 Can you give me the code to get the balance in python?
Featured Comment
Archived
This topic is now archived and is closed to further replies.