Hello, I am currently trying to get the refresh token for my scoped app using CURL C++ but I am just getting error 404 from the buffer.
Here is my code:
void get_refresh_token()
{
CURL* curl = curl_easy_init();
if (curl)
{
struct curl_slist* header_list = 0;
header_list = curl_slist_append(header_list, "Authorization: Basic <APP_KEY>:<APP_SECRET>");
header_list = curl_slist_append(header_list, "Content-Type: application/x-www-form-urlencoded");
header_list = curl_slist_append(header_list, "Dropbox-API-Arg: {\"code\":\"/<ACCESS_CODE>\",\"grant_type\": \"authorization_code\"}");
std::string buffer;
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
curl_easy_setopt(curl, CURLOPT_URL, "https://api.dropboxapi.com/oauth2/token");
CURLcode result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
curl_global_cleanup();
}
Any help would be appreciated, thank you.