Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Hey.

    Yes, myCRED has a Remote API which allows you to:

    – Get a users balance from a remote source
    – Deduct points from a user from a remote source
    – Add points from a user from a remote source and
    – Transfer points from user a to user b from a remote source

    Check out the myCRED Codex for documentation and examples.

    Thread Starter SeeingBlueS2

    (@seeingblues2)

    Can you tell me how to properly craft a simple GET url to credit someone’s account?

    Plugin Author myCred

    (@designbymerovingi)

    Use the example given in the documentation for the CREDIT action but replace:

    $response = wp_remote_post( $remote_url, $request );

    with:

    $response = wp_remote_get( $remote_url, $request );

    And further up in example replace:

    'method' => 'POST',

    with:

    'method' => 'GET',

    You can find more information about the wp_remote_get function in the WordPress codex.

    Thread Starter SeeingBlueS2

    (@seeingblues2)

    Sorry for my ignorance. I’m not very knowledgeable when it comes to this so I don’t understand everything I’m reading.

    I have managed to create a bot that checks if you are live on twitch and awards you points if so.

    With my previous credit system I was able to navigate to a URL and automatically award points. It looked like this:
    https://greatarchitect.us/api/add-points?key=&user_id=""&points=
    I’m trying to figure out what that url looks like for your plugin.

    I’ve tried a couple different URl string with no luck yet, just keep getting file not found errors.

    Plugin Author myCred

    (@designbymerovingi)

    Unfortunately myCRED does not support adding / removing points via URLs like the example you gave. The reason is because this is highly unsafe as you send your key (which supposed to be secret) in the clear right there in your URL.

    Instead the myCRED remote API requires you to create calls via script and include a security token which is generated based on your request.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remotely Awarding Points via API?’ is closed to new replies.