(Objective-C) Shopify Delete Product
Delete a product from the shop.
#import <CkoRest.h>
#import <CkoStringBuilder.h>
CkoRest *rest = [[CkoRest alloc] init];
BOOL success;
[rest SetAuthBasic: @"SHOPIFY_PRIVATE_API_KEY" password: @"SHOPIFY_PRIVATE_API_SECRET_KEY"];
success = [rest Connect: @"chilkat.myshopify.com" port: [NSNumber numberWithInt: 443] tls: YES autoReconnect: YES];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
CkoStringBuilder *sbResponse = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"DELETE" uriPath: @"/admin/products/#{id}.json" sb: sbResponse];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
if ([rest.ResponseStatusCode intValue] != 200) {
NSLog(@"%@%d",@"Received error response code: ",[rest.ResponseStatusCode intValue]);
NSLog(@"%@",@"Response body:");
NSLog(@"%@",[sbResponse GetAsString]);
return;
}
NSLog(@"%@",@"Example Completed.");
|