(Lianja) Shopify Delete Product
Delete a product from the shop.
loRest = createobject("CkRest")
loRest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")
llSuccess = loRest.Connect("chilkat.myshopify.com",443,.T.,.T.)
if (llSuccess <> .T.) then
? loRest.LastErrorText
release loRest
return
endif
loSbResponse = createobject("CkStringBuilder")
llSuccess = loRest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",loSbResponse)
if (llSuccess <> .T.) then
? loRest.LastErrorText
release loRest
release loSbResponse
return
endif
if (loRest.ResponseStatusCode <> 200) then
? "Received error response code: " + str(loRest.ResponseStatusCode)
? "Response body:"
? loSbResponse.GetAsString()
release loRest
release loSbResponse
return
endif
? "Example Completed."
release loRest
release loSbResponse
|