Objective-C / PandaDoc API Reference / Change Document Status (manually)
Back to Collection Items
#import <CkoHttp.h>
#import <CkoHttpRequest.h>
#import <CkoHttpResponse.h>
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;
CkoHttpRequest *req = [[CkoHttpRequest alloc] init];
req.HttpVerb = @"PATCH";
req.Path = @"/public/v1/documents/{{document_id}}/status";
req.ContentType = @"multipart/form-data";
success = [req AddFileForUpload2: @"file" path: @" path to file" contentType: @"application/octet-stream"];
[req AddHeader: @"Authorization" value: @"API-Key {{api_key}}"];
[req AddHeader: @"Expect" value: @"100-continue"];
CkoHttpResponse *resp = [http SynchronousRequest: @"api.pandadoc.com" port: [NSNumber numberWithInt: 443] ssl: YES req: req];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",http.LastErrorText);
return;
}
NSLog(@"%d",[resp.StatusCode intValue]);
NSLog(@"%@",resp.BodyStr);
Curl Command
curl -X PATCH
-H "Authorization: Bearer {{access_token}}"
-H "Authorization: API-Key {{api_key}}"
--form 'file=@"/path/to/file"'
https://api.pandadoc.com/public/v1/documents/{{document_id}}/status
Postman Collection Item JSON
{
"name": "Change Document Status (manually)",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}",
"type": "text",
"disabled": true
},
{
"key": "Authorization",
"value": "API-Key {{api_key}}",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": [
]
},
{
"key": "data",
"value": "{\n \"status\": 2,\n \"note\": \"A private note\",\n \"notify_recipients\": false\n}",
"type": "text"
}
]
},
"url": {
"raw": "https://api.pandadoc.com/public/v1/documents/{{document_id}}/status",
"protocol": "https",
"host": [
"api",
"pandadoc",
"com"
],
"path": [
"public",
"v1",
"documents",
"{{document_id}}",
"status"
]
}
},
"response": [
]
}