# Introduction

The Docamatic API is a RESTful API based on HTTPS requests and JSON responses. The API provides 6 main endpoints:

# Quick Start

Here are some code samples to get you started. All requests must be made over HTTPS and must contain your API key in the header as a bearer token.

    
	$headers = [
'x-DomainKey: YOUR_API_KEY',
'Content-Type: application/json'
];

$data = [
'from_country' => '107',
'to_country' => '2',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://visaclap.com/visaclapapi/api/visacountry');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);

if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
var_dump(json_decode($response, true));
}

curl_close($ch);

# Response Codes

The status of a response can be determined from the HTTP status code.

Code Status Description
200 OK Request successful
400 Bad request Request was invalid
422 Unprocessable Entity Valid JSON but error encountered
429 Too Many Requests Client is rate limited
500 Internal Server Error Server error, please try again later or contact support

# Endpoints

The Docamatic API is accessed by making HTTPS requests to a specific version endpoint URL. The base URL for the API is: https://visaclap.com/visaclapapi/api . The following endpoints are available:

URL Method Description
/visacountry GET Get All Country
/Getcountryname POST Get Particular Country data
/visacountry POST Get Visa data
GET /visacountry
GET http://visaclap.com /visaclapapi/api/visacountry

This endpoint provides a summary of your API usage for the current billing period. Assuming a monthly limit of 1000 requests, after 250 production requests:

Response:
    
								{
	 "code": 200,
	"message": [
		{
			"id": "1",
			"name": "Andorra",
			"currency": "Euro (EUR)",
			"capital": "Andorra la Vella"
		},
		{
			"id": "2",
			"name": "United Arab Emirates",
			"currency": "Dirham (AED)",
			"capital": "Abu Dhabi"
		},
		{
			"id": "3",
			"name": "Afghanistan",
			"currency": "Afghani (AFN)",
			"capital": "Kabul"
		}
		]
}

POST /Getcountryname
POST http://visaclap.com /visaclapapi/api/Getcountryname

This endpoint allows you to generate a PDF document from a URL or HTML . The source parameter is the only mandatory body parameter. All other parameters are optional. Example requests can be found below this table.

Parameter Type Description
countryid number A valid URL or HTML.

# Description

The following request will create an A4 document using a URL passed via the source parameter. We have set the media type to print so that the resulting document will be generated using the CSS print rules that have been defined at this URL. We have set top and bottom margins on the page. As we did not specify margin_unit , margins will use default unit cm.

Request:
    
	{
"countryid": "235"
}

Response:
    
   {
"status": true,
"countrydata": [
	{
		"id": "235",
		"name": "United States",
		"currency": "Dollar (USD)",
		"capital": "Washington",
		"description": "The United States (U.S) is one of the most popular travel tourist destinations around the world. Each year, the country’s famous cities, national parks and entertainment options attract millions of visitors from around the world. From the skyscrapers of New York and Chicago, the natural wonders of Yellowstone and Alaska, to the sunny beaches of California, Florida, and Hawaii, the United States has an amazing amount of tourist destinations. The best time to visit u.s is either during spring (early march to late may) or autumn (early September to late October). Since these are the shoulder seasons before and after summer, these months tend to have warmer temperatures as well as fewer visitors to the most popular destinations."
	}
]
}

POST /GetCountryVisa
POST http://visaclap.com /visaclapapi/api/visacountry
Parameter Type Description
from_country number countrydata = id
to_country number countrydata = id

# Description

The following request will create an A4 document using a URL passed via the source parameter. We have set the media type to print so that the resulting document will be generated using the CSS print rules that have been defined at this URL. We have set top and bottom margins on the page. As we did not specify margin_unit , margins will use default unit cm.

Request:
    
   from_country:107
to_country:235

Response:
    {
"status": true,
"message": [
	{
		"id": "3508",
		"origin_country": "107",
		"destination_country": "79",
		"process": "Do payment,Enter Information,Get E-Visa",
		"price": "100-$",
		"visa_type_id": "199",
		"visa_validity": "6-Month",
		"length_of_stay": "180-Days",
		"time_to_get_visa": "20-Days",
		"entry_type": "Multiple",
		"description": "For visiting family and friends and for tourism",
		"service_charge": "500-$",
		"type_of_visa": "Standard Visitor Visa",
		"all_document_id": "111",
		"all_document_name": "65,67,88,107",
		"visaformcompare": "235",
		"process_docu": "8,9,12",
		"visa_type_form_id": "235"
	}
],
"documents": [
	[
		{
			"id": "111",
			"name": "united kingdom standard visitor visa",
			"document_id": "65,67,88,107",
			"date": "2023-09-11 22:26:33",
			"document_name": "Bank Account Statement,Hotel confirmation (if you dont have any friends or family or business associates),Invitation From your Family or Friends,Passport front and back picture"
		}
	]
],
"process": [
	[
		{
			"id": "8",
			"text": "Enter Information",
			"image": "assets/uploads/apply.jpg"
		}
	],
	[
		{
			"id": "9",
			"text": "Do payment",
			"image": "assets/uploads/payment.jpg"
		}
	],
	[
		{
			"id": "12",
			"text": "Get E-Visa",
			"image": "assets/uploads/evisa-min.jpg"
		}
	]
],
"notes": [
	[
		{
			"id": "3508",
			"notes": "58",
			"note_name": "Uk Standard Visitor Visa notes",
			"notes_desc": "If you are applying for a visa where you can stay in the UK for more than 6 months you may need to get a TB test depending on where you are applying from"
		}
	]
]
}