fork download
  1.  
  2.  
  3. <?php
  4. $url = "https://a...content-available-to-author-only...p.com/v2/event/371937?storeEvent=true";
  5.  
  6. $data = [
  7. "folderId" => 39466667,
  8. "contentType" => 3,
  9. "contentId" => 64294843
  10. ];
  11.  
  12. $payload = json_encode($data);
  13.  
  14. $ch = curl_init($url);
  15.  
  16. curl_setopt($ch, CURLOPT_POST, true);
  17. curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
  18. curl_setopt($ch, CURLOPT_HTTPHEADER, [
  19. 'Content-Type: application/json',
  20. 'Content-Length: ' . strlen($payload)
  21. // Add authorization header here if needed:
  22. // 'Authorization: Bearer YOUR_ACCESS_TOKEN'
  23. ]);
  24. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  25.  
  26. $response = curl_exec($ch);
  27.  
  28. if(curl_errno($ch)){
  29. echo 'Request Error:' . curl_error($ch);
  30. } else {
  31. echo 'Response:' . $response;
  32. }
  33.  
  34.  
  35. ?>
Success #stdin #stdout 0.03s 26520KB
stdin
Standard input is empty
stdout

Request Error:Could not resolve host: api.classplusapp.com