Skip to content

features/WinPage-PostAPICall #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
saamerm opened this issue Mar 18, 2021 · 0 comments
Open

features/WinPage-PostAPICall #59

saamerm opened this issue Mar 18, 2021 · 0 comments

Comments

@saamerm
Copy link
Owner

saamerm commented Mar 18, 2021

  • Create a function in the WinPage that gets called as soon as the page is loaded
  • This function should make a POST api call as shown with the details below
  • This function is responsible for storing the scores in the database table, no UI change is needed

If you make a POST API call to this URL:
https://script.google.com/macros/s/AKfycbyYixMarhPEUj3UVzOxWne1bJnMZDOcXUn3dHA4UrP21L_qA673bCkeG6Liys7c6oj5PA/exec

This is the body that you will send, along with the response you should expect:

So the code MIGHT look something like this, I m not sure. Ask @amiraelsayedbadwy for help on this if you have any issue

    private async Task GetApiCall()
    {            
        var url = "https://script.google.com/macros/s/AKfycbyYixMarhPEUj3UVzOxWne1bJnMZDOcXUn3dHA4UrP21L_qA673bCkeG6Liys7c6oj5PA/exec";
        var client = new HttpClient();
        var data = ..... (something that you 'll need to figure out)
        var response = await client.PostAsync(url, data);
        var result = await response.Content.ReadAsStringAsync();
        var scoreItems = JsonConvert.DeserializeObject<List<ScoreItem>>(result);
    }

Here's the article for reference https://medium.com/@prototypemakers/simplest-universal-free-game-leaderboard-with-google-sheets-5ab548db009f

Allotted Time: 4 hrs
Time Taken: 2 hrs

features/59-LeaderboardPage-PostAPICall

@saamerm saamerm changed the title NumberBomb POST api call features/WinPage-PostAPICall Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant