(Tcl) Shopify Delete Product
Delete a product from the shop.
load ./chilkat.dll
set rest [new_CkRest]
CkRest_SetAuthBasic $rest "SHOPIFY_PRIVATE_API_KEY" "SHOPIFY_PRIVATE_API_SECRET_KEY"
set success [CkRest_Connect $rest "chilkat.myshopify.com" 443 1 1]
if {$success != 1} then {
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
exit
}
set sbResponse [new_CkStringBuilder]
set success [CkRest_FullRequestNoBodySb $rest "DELETE" "/admin/products/#{id}.json" $sbResponse]
if {$success != 1} then {
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
delete_CkStringBuilder $sbResponse
exit
}
if {[CkRest_get_ResponseStatusCode $rest] != 200} then {
puts "Received error response code: [CkRest_get_ResponseStatusCode $rest]"
puts "Response body:"
puts [CkStringBuilder_getAsString $sbResponse]
delete_CkRest $rest
delete_CkStringBuilder $sbResponse
exit
}
puts "Example Completed."
delete_CkRest $rest
delete_CkStringBuilder $sbResponse
|