Finish Editing a Document File in C/C++
Finishing up the editing of an online document has never been so easy. By using the following API in C/C++, you will able to automatically close out the editing process and download the result. The Finish Editing API is the sister function to the Begin Editing function, so you will need the editing URL from that to successfully wrap things up.
We will start the process off by installing libcurl:
libcurl/7.75.0
After this, we can call the function by inputting the URL and API key into the below example code:
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.cloudmersive.com/convert/edit/finish-editing");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "Apikey: YOUR-API-KEY-HERE");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "InputFileUrl=%3Cstring%3E";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
If you need to obtain an API key, you can do so by registering for a free account on the Cloudmersive website; this provides 800 calls/month across any of our APIs.