Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
Last active December 21, 2020 15:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ultimatemember/44d89249baf9f73b89d6 to your computer and use it in GitHub Desktop.
Save ultimatemember/44d89249baf9f73b89d6 to your computer and use it in GitHub Desktop.
Using the new RESTful API to process remote queries
// API Request
$url = 'http://localhost/um-api/get.user/?id=1';
// Include your public key and token to the URL
$url = add_query_arg('key', '75d9a913782eee3d990e4464ce26213e', $url );
$url = add_query_arg('token', 'bae6ee38cf02a50a0ac8259eed34ceb9', $url );
// Process your request
$request = wp_remote_get( $url );
$response = json_decode( wp_remote_retrieve_body( $request ) , true );
// That's it, now you can use/print the returned response
print_r( $response );
@jerusalemfonseca
Copy link

Where should I get my public key and token?

@codementa
Copy link

I got the same question

@stubbulon5
Copy link

+1. It would get great if someone could answer this ... Where to get the key and token to make this call ?

I will research further and update if I find out!

@Gurbhej
Copy link

Gurbhej commented Dec 21, 2020

Did anyone find out where to get the PUBLIC KEY & TOKEN from??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment