POST
https://camping.care/api/v1/park/age_tables
Authentication:
Get age tables of your park
Parameters
STRING
Request the accommodation data in a different language (ISO Language Code)
Response
201
application/json; charset=utf-8
Integer
id of the age table
String
name of the age table
Integer
age from for age tabel
Integer
age to for age tabel
Enum
Enumeration of type 'years' or 'months'
int
Rank number of the age table
Example
/*
* Example get age tables - How to get age table information from the Camping.care API
* https://camping.care/developer/park/get_age_tables
*/
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:
* language : ISO language code (optional)
*
*/
$data = array();
$data['language'] = "de" ;
/*
* All data is returned in a age table opject
* The structure can be found here: https://camping.care/developer/park/get_age_tables.
*/
$age_tables = $campingcare->get_age_tables($data);
/*
* In this example we print the data in json format on the page
*/
echo "Age table data";
echo "";
echo json_encode($age_tables, 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 age_tables
{
/*
* Example get age tables - How to get age table information from the Camping.care API
* https://camping.care/developer/park/get_age_tables
*/
public static async void get_age_tables()
{
try
{
Console.WriteLine("*************************************");
Console.WriteLine("*** GET AGE TABLES ***");
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 send_data = new List>();
/*
* All data is returned in a age table opject
* The structure can be found here: https://camping.care/developer/park/get_age_tables.
*/
var data = await camping_care.get_age_tables(send_data);
/*
* 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
{
"0": {
"id": "1",
"name": "Extra Person",
"age_from": "11",
"age_to": null,
"period": "years",
"rank": "0"
},
"1": {
"id": "2",
"name": "Child",
"age_from": "0",
"age_to": "11",
"period": "years",
"rank": "1"
}
"n": {
.....
}
}
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
1000
1007
1008
1009
1000
1007
1008
1009