Home Features Pricing Contact Login

REST API

Get contact

GET
https://camping.care/api/v1/contacts/id

Autorication: API Key

Get a specific contact by id.

Parameters

Replace id in the endpoint URL by the invoice id, for example: "https://camping.care/api/v1/contacts/2".

Response

201
application/json; charset=utf-8
id
Integer
The id of the contact
contact_id
Integer
The contact_id of the administration (own number)
name
String
The id of the contact for this invoice
created
DateTime
The creation date of the contact
company
String
Company name of the contact
first_name
String
first name of the contact
last_name
String
last name of the contact
gender
String
gender of the contact
gender
String
gender of the contact
birthday
String
birthday of the contact
zipcode
String
zipcode of the contact
city
String
city of the contact
address
String
address of the contact
address_number
String
address number of the contact
email
String
email of the contact
country
String
country of the contact
phone
String
phone of the contact
phone_mobile
String
phone mobile of the contact
vat_number
String
vat number mobile of the contact
reservation_count
String
reservation count of the contact
inv_count_invoice_active
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
code
Integer
The error code listed in a list below
message
String
The error message listed in a list below

Error Codes

5000
No valid API key
5003
No contact found
5004
No admin ID found
5005
No rights for this contact
0%
()

Cancel upload