• Hi,
    I am a student and new to wordpress. I am trying to link iScore stats to my wordpress site for a baseball team.
    Within the iScore Team Website iScore docum,entation is talks about AJAX Call to Team Website API – Get Cumulative Stats, the code they provide is:
    $.ajax({
    context: this,
    type: “GET”,
    url: “https://api.iscoresports.com/teamwebsite/cumulativestats.php”,
    data: { s: $(“#sport”).val(), t: $(“#team”).val(), p: $(“#pwd”).val(), json: “1” },
    dataType: “jsonp”,
    success: function(data)
    {
    showResult(data);
    },
    error: function()
    {
    alert(“An error occurred in the request”);
    }
    });

    Where do I put this code within wordpress?

    Any help would be much appreciated.

    You can view my site at:

    https://www.baseball.martinkleis.org

    Thankyou
    Martin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You want to make sure that the API call is correct first: https://api.iscoresports.com/teamwebsite/cumulativestats.php

    Visit that URL and see if you actually get data, or get an error message

    Thread Starter n3151120

    (@n3151120)

    Hi,
    Thank you Andrew,

    yes I get the following error:

    <ERROR name=”Invalid Login” description=”Invalid team or API password supplied”/>

    Not sure what to do though

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’ll need to liaise with the people behind the API to first get the right data out

    Thread Starter n3151120

    (@n3151120)

    Hi Andrew,

    Many thanks for your help, I will contact my support desk, although they are US Pacific time, so wont get a reply for a while, but thanks for trying to help.

    Regards
    Martin

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add API to wordpress’ is closed to new replies.