(Visual FoxPro) Shopify Delete Product
Delete a product from the shop.
LOCAL loRest
LOCAL lnSuccess
LOCAL loSbResponse
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Rest')
loRest = CreateObject('Chilkat.Rest')
loRest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")
lnSuccess = loRest.Connect("chilkat.myshopify.com",443,1,1)
IF (lnSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponse = CreateObject('Chilkat.StringBuilder')
lnSuccess = loRest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",loSbResponse)
IF (lnSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
RELEASE loSbResponse
CANCEL
ENDIF
IF (loRest.ResponseStatusCode <> 200) THEN
? "Received error response code: " + STR(loRest.ResponseStatusCode)
? "Response body:"
? loSbResponse.GetAsString()
RELEASE loRest
RELEASE loSbResponse
CANCEL
ENDIF
? "Example Completed."
RELEASE loRest
RELEASE loSbResponse
|