wpsharks / s2member-kb

The s2Member® and s2Member® Pro Knowledge Base
9 stars 4 forks source link

Pro API for Remote Operations #223

Open raamdev opened 9 years ago

raamdev commented 9 years ago

KB Article Creation Checklist

Additional TODO list items go here.


:octocat: View Markdown File | :pencil2: Edit Markdown File :page_with_curl: Published KB Article: http://s2member.com/kb-article/pro-api-for-remote-operations/


yaronelh commented 9 years ago

The article only talks about PHP, it would be nice to know if other languages are supported in remote Operators. And maybe an example in another language other than PHP.

Other articles even linked in this one, talk about constance and globals in js, so it would be nice to have some additional information here

A few words about that, would have saved me the ticket.

jaswrks commented 9 years ago

@yaronelh Thanks for the feedback. I'm reopening this issue for further enhancements.

yaronelh commented 9 years ago

@jaswsinc You're welcome, and thank you for the answer you sent in the ticket. We are still working with that, trying to make it work for what we need. Cheers.

renzms commented 8 years ago

Work in progress for cURL equivalent for file_get_contents()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://my-url.com/?s2member_pro_remote_op=1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HEADER => false,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => "content-type: application/x-www-form-urlencoded",
  CURLOPT_POSTFIELDS     => 's2member_pro_remote_op='.urlencode(serialize($op)),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
hassankhan87 commented 2 years ago

Any example in .net core c# or postman? @raamdev @jaswrks