(PowerBuilder) Shopify Delete Product
Delete a product from the shop.
integer li_rc
oleobject loo_Rest
integer li_Success
oleobject loo_SbResponse
loo_Rest = create oleobject
li_rc = loo_Rest.ConnectToNewObject("Chilkat_9_5_0.Rest")
if li_rc < 0 then
destroy loo_Rest
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")
li_Success = loo_Rest.Connect("chilkat.myshopify.com",443,1,1)
if li_Success <> 1 then
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
return
end if
loo_SbResponse = create oleobject
li_rc = loo_SbResponse.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
li_Success = loo_Rest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",loo_SbResponse)
if li_Success <> 1 then
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
destroy loo_SbResponse
return
end if
if loo_Rest.ResponseStatusCode <> 200 then
Write-Debug "Received error response code: " + string(loo_Rest.ResponseStatusCode)
Write-Debug "Response body:"
Write-Debug loo_SbResponse.GetAsString()
destroy loo_Rest
destroy loo_SbResponse
return
end if
Write-Debug "Example Completed."
destroy loo_Rest
destroy loo_SbResponse
|