Retrieves the details of an existing file object. Supply the unique file upload ID from a file creation request, and Stripe will return the corresponding transfer information.
curl https://files.stripe.com/v1/files/file_1BnEEuGswQrCoh0XqB3XkqAg \
-u STRIPE_SECRET_KEY:
#include <CkRestW.h>
#include <CkStringBuilderW.h>
#include <CkJsonObjectW.h>
void ChilkatSample(void)
{
CkRestW rest;
bool success;
// URL: https://files.stripe.com/v1/files/file_1BnEEuGswQrCoh0XqB3XkqAg
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect(L"files.stripe.com",port,bTls,bAutoReconnect);
if (success != true) {
wprintf(L"ConnectFailReason: %d\n",rest.get_ConnectFailReason());
wprintf(L"%s\n",rest.lastErrorText());
return;
}
rest.SetAuthBasic(L"STRIPE_SECRET_KEY",L"");
CkStringBuilderW sbResponseBody;
success = rest.FullRequestNoBodySb(L"GET",L"/v1/files/file_1BnEEuGswQrCoh0XqB3XkqAg",sbResponseBody);
if (success != true) {
wprintf(L"%s\n",rest.lastErrorText());
return;
}
CkJsonObjectW jsonResponse;
jsonResponse.LoadSb(sbResponseBody);
const wchar_t *id = 0;
const wchar_t *object = 0;
int created;
const wchar_t *filename = 0;
const wchar_t *purpose = 0;
int size;
const wchar_t *type = 0;
const wchar_t *url = 0;
id = jsonResponse.stringOf(L"id");
object = jsonResponse.stringOf(L"object");
created = jsonResponse.IntOf(L"created");
filename = jsonResponse.stringOf(L"filename");
purpose = jsonResponse.stringOf(L"purpose");
size = jsonResponse.IntOf(L"size");
type = jsonResponse.stringOf(L"type");
url = jsonResponse.stringOf(L"url");
}
{
"id": "file_1BnEEuGswQrCoh0XqB3XkqAg",
"object": "file_upload",
"created": 1516661888,
"filename": "path",
"purpose": "sigma_scheduled_query",
"size": 500,
"type": "csv",
"url": "https://stripe-upload-api.s3.amazonaws.com/uploads/file_1BnEEuGswQrCoh0XqB3XkqAg?AWSAccessKeyId=KEY_ID\u0026Expires=TIMESTAMP\u0026Signature=SIGNATURE"
}