Enquiry

This API allows to create, view, update, and delete enquiry.

Enquiry Properties #

AttributeTypeDescription
enquiry_idintegerUnique identifier for the object. ( Read-Only )
enquiry_namestringTitle of the Enquiry.
enquiry_datedateCreated date of Enquiry.
enquiry_date_gmtdateCreated date of Enquiry in GTM.
enquiry_metasarrayEnquiry meta data.

Coupon_metas

AttributeTypeDescription
enquiry_trip_idintegerID of trip.
enquiry_emailstringEmail Address.
enquiry_querystring Enquiry query.

Add Enquiry #

This API helps to add enquiry.

POST

/wp-json/wptravel/v1/add-enquiry

curl --location 'https://example.com/wp-json/wptravel/v1/add-enquiry' \
--header 'Authorization: Basic <application-key>' \

--form 'enquiry_name="DevWen"' \
--form 'enquiry_email="test@test.com"' \
--form 'enquiry_query="Is this trip available??"' \
--form 'enquiry_trip_id="30"'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Basic <application-key>");

var formdata = new FormData();
formdata.append("enquiry_name", "DevWen");
formdata.append("enquiry_email", "test@test.com");
formdata.append("enquiry_query", "Is this trip available??");
formdata.append("enquiry_trip_id", "30");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/add-enquiry", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Basic <application-key>'
];

$options = [
  'multipart' => [
    [
      'name' => 'enquiry_name',
      'contents' => 'DevWen'
    ],
    [
      'name' => 'enquiry_email',
      'contents' => 'test@test.com'
    ],
    [
      'name' => 'enquiry_query',
      'contents' => 'Is this trip available??'
    ],
    [
      'name' => 'enquiry_trip_id',
      'contents' => '30'
    ]
]];

$request = new Request('POST', 'https://example.com/wp-json/wptravel/v1/add-enquiry', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();

Update Enquiry #

This API helps to update enquiry by ID.

POST

/wp-json/wptravel/v1/update-enquiry/40

curl --location 'https://example.com/wp-json/wptravel/v1/update-enquiry/40' \
--header 'Authorization: Basic <application-key>' \

--form 'enquiry_name="DevWen"' \
--form 'enquiry_email="test@test.com"' \
--form 'enquiry_query="Is this trip available??"' \
--form 'enquiry_trip_id="7"'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Basic <application-key>");

var formdata = new FormData();
formdata.append("enquiry_name", "DevWen");
formdata.append("enquiry_email", "test@test.com");
formdata.append("enquiry_query", "Is this trip available??");
formdata.append("enquiry_trip_id", "7");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/update-enquiry/40", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Basic <application-key>'
];
$options = [
  'multipart' => [
    [
      'name' => 'enquiry_name',
      'contents' => 'DevWen'
    ],
    [
      'name' => 'enquiry_email',
      'contents' => 'test@test.com'
    ],
    [
      'name' => 'enquiry_query',
      'contents' => 'Is this trip available??'
    ],
    [
      'name' => 'enquiry_trip_id',
      'contents' => '7'
    ]
]];

$request = new Request('POST', 'https://example.com/wp-json/wptravel/v1/update-enquiry/40', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();

Delete Enquiry #

This API helps you to delete enquiry by ID.

DELETE

/wp-json/wptravel/v1/delete-enquiry/8

curl --location --request DELETE 'https://example.com/wp-json/wptravel/v1/delete-enquiry/8' \
--header 'Authorization: Basic <application-key>'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Basic <application-key>");

var requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/delete-enquiry/8", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var myHeaders = new Headers();
myHeaders.append("Authorization", "Basic <application-key>");

var requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/delete-enquiry/8", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Enquiry #

This API helps to get an enquiry by ID.

GET

/wp-json/wptravel/v1/get-enquiry/41

curl --location 'https://example.com/wp-json/wptravel/v1/get-enquiry/41'
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/get-enquiry/41", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
<?php
$client = new Client();
$request = new Request('GET', 'https://example.com/wp-json/wptravel/v1/get-enquiry/41');
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

JSON Response

{
    "enquiry_id": 41,
    "enquiry_name": "Enquiry - WT - DevWen",
    "enquiry_status": "publish",
    "enquiry_author": "0",
    "enquiry_date": "2023-04-04 08:41:09",
    "enquiry_date_gmt": "2023-04-04 08:41:09",
    "enquiry_metas": {
        "post_id": "30",
        "wp_travel_enquiry_name": "DevWen",
        "wp_travel_enquiry_email": "test@test.com",
        "wp_travel_enquiry_query": "Is this trip available??"
    }
}

Get All Enquires #

This API helps to get all enquires.

GET

/wp-json/wptravel/v1/get-enquiries

curl --location 'https://example.com/wp-json/wptravel/v1/get-enquiries'
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://example.com/wp-json/wptravel/v1/get-enquiries", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
<?php
$client = new Client();
$request = new Request('GET', 'https://example.com/wp-json/wptravel/v1/get-enquiries');
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

JSON Response

[
    {
        "enquiry_id": 41,
        "enquiry_name": "Enquiry - WT - DevWen",
        "enquiry_status": "publish",
        "enquiry_author": "0",
        "enquiry_date": "2023-04-04 08:41:09",
        "enquiry_date_gmt": "2023-04-04 08:41:09",
        "enquiry_metas": {
            "post_id": "30",
            "wp_travel_enquiry_name": "DevWen",
            "wp_travel_enquiry_email": "test@test.com",
            "wp_travel_enquiry_query": "Is this trip available??"
        }
    },
    {
        "enquiry_id": 40,
        "enquiry_name": "Enquiry - WT - Test",
        "enquiry_status": "publish",
        "enquiry_author": "0",
        "enquiry_date": "2023-04-04 08:39:35",
        "enquiry_date_gmt": "2023-04-04 08:39:35",
        "enquiry_metas": {
            "post_id": "7",
            "wp_travel_enquiry_name": "Test",
            "wp_travel_enquiry_email": "test@test.com",
            "wp_travel_enquiry_query": "Is this trip available??"
        }
    }
]