GET
https://camping.care/api/v1/contacts/id
Autorication:
Get a specific contact by id.
Parameters
ReplaceResponse
201
application/json; charset=utf-8
Integer
The id of the contact
Integer
The contact_id of the administration (own number)
String
The id of the contact for this invoice
DateTime
The creation date of the contact
String
Company name of the contact
String
first name of the contact
String
last name of the contact
String
gender of the contact
String
gender of the contact
String
birthday of the contact
String
zipcode of the contact
String
city of the contact
String
address of the contact
String
address number of the contact
String
email of the contact
String
country of the contact
String
phone of the contact
String
phone mobile of the contact
String
vat number mobile of the contact
String
reservation count of the contact
String
active invoice count of the contact
Example
/*
* Example get contacts - How to get a specific contacts from the Camping.care API
* https://camping.care/developer/contacts/get_contact
*/
try{
/*
* Initialize the Camping.care API SDK with your API key.
*
* See: https://camping.care/settings/api
*/
require_once dirname(__FILE__) . '/../../src/campingcare/Autoloader.php';
$campingcare = new campingcare_api ;
$campingcare->set_api_key('YOUR API KEY');
/*
* Set your contact id. It can be found by using the function get_contacts
* https://camping.care/developer/contacts/get_contacts
*/
$contact_id = 1;
/*
* Parameters:
* None
*
*/
/*
* All data is returned in a contact object
* The structure can be found here: https://camping.care/developer/contacts/get_contact.
*/
$contact= $campingcare->get_contact($contact_id);
/*
* In this example we print the data in json format on the page
*/
echo "Contact";
echo "";
echo json_encode($contact, JSON_PRETTY_PRINT);
echo "
";
}catch(Exception $e){
echo "API call failed: " . htmlspecialchars($e->getMessage());
}
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using campingcare;
using Newtonsoft.Json.Linq;
namespace campingcare_csharp_sdk_tests
{
public static class contact
{
/*
* Example get contacts - How to get a specific contacts from the Camping.care API
* https://camping.care/developer/contacts/get_contact
*/
public static async void get_contact()
{
try
{
Console.WriteLine("*************************************");
Console.WriteLine("*** GET CONTACT ***");
Console.WriteLine("*************************************");
/*
* Initialize the Camping.care API SDK with your API key.
*
* See: https://camping.care/settings/api
*/
campingcare_api camping_care = new campingcare_api();
camping_care.set_api_key("YOUR API KEY");
/*
* Set your contact id. It can be found by using the function get_contacts
* https://camping.care/developer/contacts/get_contacts
*/
int id = 191;
/*
* Parameters:
* None
*
*/
var send_data = new List>();
/*
* All data is returned in a contact object
* The structure can be found here: https://camping.care/developer/contacts/get_contact.
*/
var data = await camping_care.get_contact(id, send_data);
/*
* In this example we print the oprions in json format on the page
*/
JObject json = JObject.Parse(data.ToString());
foreach (var pair in json)
{
Console.WriteLine("{0}: {1}", pair.Key, pair.Value);
}
}
catch (Exception ex)
{
LogData(ex.Message);
}
}
private static void LogData(string Message)
{
Console.WriteLine("Error: " + Message);
}
}
}
Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "1",
"contact_id": "1",
"admin_id": "1",
"name": "John Doe",
"created": "2017-12-22 08:16:25",
"status": "active",
"company": "",
"first_name": "John",
"last_name": "Doe",
"gender": "male",
"birthday": "1986-01-25",
"zipcode": "1234AB",
"city": "Amsterdam",
"address": "Canalroad",
"address_number": "1",
"email": "johndoe@example.com",
"country": "NL",
"phone": "0612345678",
"phone_mobile": "",
"vat_number": "",
"reservation_count": "1",
"inv_count_invoice_active": "1"
}
Response Error
Returns an array with error information
230
application/json; charset=utf-8
Integer
The error code listed in a list below
String
The error message listed in a list below
Error Codes
5000
5003
5004
5005
5000
5003
5004
5005