Set your default language: PHP | Curl

POST places

Create a new Place

Details

URL https://api.heello.com/places.format
Requires Authentication Yes
Rate Limited Yes
Response Formats json

Parameters

Parameter Required Notes
access_token Access token of authenticated user creating the Ping.
place[name] Name of the place being added.
place[latitude] Latitude of place being added. Only decimal degrees are accepted latitude values (i.e. 32.78411)
place[longitude] Longitude of place being added. Only decimal degrees are accepted longitude values (i.e. -79.93823)
place[address] Address of the place being added.
place[country] Country of the place being added.
place[locality] City of the place being added.
place[postcode] Postal code of the place being added.
place[region] State / territory of the place being added.
place[phone] Phone number of the place being added.
place[category_id] Category ID of the place being added. See our category documentation for more information about getting an appropriate category id.

Errors

There are no unique error states for this endpoint, please see our page detailing general errors you may encounter.

Example Usage

POST https://api.heello.com/places.json
curl \
-d "place[name]=Heello HQ" \
-d "place[latitude]=32.79300" \
-d "place[longitude]=-79.94145" \
-d "place[country]=United States" \
-d "place[locality]=Charleston" \
-d "place[region]=South Carolina" \
-d "access_token=ACCESS_TOKEN" \
-X POST "https://api.heello.com/places.json"
// Note: PHP Examples use the Heello PHP Client library
// https://github.com/Heello/heello-php
require_once dirname(dirname(dirname(__FILE__))) . '/Heello.php';

// You can get an Application Key and Secret by visiting:
// http://developer.heello.com/apps
$api_application_key = "APPLICATION_KEY";
$api_application_secret = "APPLICATION_SECRET";

// You can get an access token and refresh token by implementing the auth
// flow described at (or use the demo provided):
// http://developer.heello.com/guides/authentication
$access_token = "ACCESS_TOKEN";

$api = new Heello\Client($api_application_key, $api_application_secret);
Heello\Client::config()->set_access_token($access_token);

try{
  $response = $api->places->create(array(
    "place" => array(
      "name" => "Heello HQ",
      "latitude" => 32.79300,
      "longitude" => -79.94145,
      "country" => "United States",
      "locality" => "Charleston",
      "region" => "South Carolina"
    )
  ));

  // Dump All Response Data
  print_r($response);
} catch (Exception $e){
  print $e->getMessage();
}
On a successul request, a '201 Created' response is sent
with a place object for the place created.

See endpoint documentation for places/show for details.

Live Demo

Please login and create an application to perform live API testing.