# Invite by API - no response

**URL:** <https://meta.discourse.org/t/invite-by-api-no-response/87204>\
**Category:** Product Support\
**Created:** [May 10, 2018, 8:00pm UTC](https://meta.discourse.org/t/invite-by-api-no-response/87204 "2018-05-10T20:00:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [May 10, 2018, 9:13pm UTC](https://meta.discourse.org/t/invite-by-api-no-response/87204/3 "2018-05-10T21:13:04Z")

</div>

This worked for me:

```plaintext
<?php

$fields = array(
  'api_key' => 'a71cb5058c6be27e42806ad788bc7b0008af9c15170d1be1827a24c8e8334107',
  'api_username' => 'blake.erickson',
  'email' => 'test' . rand() . '@example.com',
  'custom_message' => 'Please join my awesome forum'
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://localhost:3000/invites");
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);

curl_close ($ch);

print_r($server_output);
?>

```

> <https://stackoverflow.com/questions/2138527/php-curl-and-http-post-example/2138534#2138534>

---

_[View the full topic](https://meta.discourse.org/t/invite-by-api-no-response/87204)._
