Home Features Pricing Contact Login

REST API

Get webhook

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

Autorication: API Key

Get a specific webhook by id.

Parameters

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

none
201
application/json; charset=utf-8
id
Integer
The id of the webhook
url
STRING
The url of the webhook
source
STRING
The source of the channel for this webhook
rights
ARRAY
The webhook function ids which are enabled for this webhook

Example


/*
* Example get webhook - How to get a webhook from the Camping.care API
* https://camping.care/developer/webhooks/get_webhook
*/

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');

	/*
    * Parameters:
    * none
    *
    */


 	/*
    * webhook id: The webhook id
    */

    $webhook_id = 1;
	/*
	* All data is returned in a webhook object
	* The structure can be found here: https://camping.care/developer/webhook/get_webhook.
	*/

    $reservations = $campingcare->get_webhook($webhook_id); 

    /*
    * In this example we print the data in json format on the page
    */

    echo "Get webhook";
    echo "
";
    echo json_encode($reservations, JSON_PRETTY_PRINT);
    echo "
"; } catch (Exception $e) { echo "API call failed: " . htmlspecialchars($e->getMessage()); }
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 webhooks
    {
        /*
        * Example get webhook - How to get a webhook from the Camping.care API
		* https://camping.care/developer/webhooks/get_webhook
        */

        public static async void get_reservations()
        {
            try
            {
                Console.WriteLine("*************************************");
                Console.WriteLine("***         GET WEBHOOK           ***");
                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");


                /*
                * Parameters:
                * none
                *
                */

         		var webhook_id = 1;

                /*
                * All data is returned in a reservation object
                * The structure can be found here: https://camping.care/developer/webhooks/get_webhook.
                */

                var data = await camping_care.get_reservations(webhook_id);



                /*
                * In this example we print the oprions in json format in the console
                */

                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,
    "url": "https:\/\/camping.care\/webhooks\/get_post_data",
    "rights": [
        201,
        202,
        203
    ]
}



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

8000
No valid API key
8020
No webhook found
8021
No admin ID found
8022
"No valid webhook id
8023
No webhook found
8024
No rights for this webhook
0%
()

Cancel upload

Powered by Camping.care