PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12/22/2017 3:04 PM by  Will Strohl
API return error
 21 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Page 4 of 5 << < 12345 > >>
Author Messages





New Member






--
10/27/2017 8:21 AM
[quote=Adrian;396]I take that back, I think we can make it even easier. If you push that data to the new db/table you can just read from that table during your checkout process or at that time they add to the cart to check stock.

https://hotcakescommerce....-Integration-Project

https://hotcakescommerce....ints[/quote]

Adrian,

I have reviewed your links and I think we are on a different page. (Or maybe just me!)
I don't need help with designing what I want to do but I just need help on the specific details of using the HCC API. Is it the case that the dll "HAS" to be run from the hosting site? Is it also the case that the Rest API call also has to be run from the hosting site? I have asked several people about this and I can't seem to get a definitive answer. Thanks.





Veteran Member






--
10/27/2017 12:57 PM
Kurt:

First, a bit of advice about integrations, and this applies to any system, not just Hotcakes or DNN. It's a best practice at all times to use the given API to perform any data updates. The database of any software solution is rarely meant for you to directly access. When you integrate directly with the database, you run the risk of upgrades breaking your integration (every time), and you'll almost certainly miss some of the additional updates that the API makes (which you can't see in the database alone).

With that being said, this is not an easy question to answer because none of us know the capabilities of the accounting system. The Hotcakes API itself can be accessed from any remote location by default. So, the real question here is, what capabilities does the accounting system have to allow you to call other API's?
Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





New Member






--
10/27/2017 1:17 PM
[quote=Will Strohl;404]Kurt:
With that being said, this is not an easy question to answer because none of us know the capabilities of the accounting system. The Hotcakes API itself can be accessed from any remote location by default. So, the real question here is, what capabilities does the accounting system have to allow you to call other API's?[/quote]
Will,
Okay. Take the abilities of the accounting system out of it because I have been writing additions, changes and enhancements to this line of software for over 20 years. I can make it do anything.
If you go back to the top of the thread, you will see that I had a simple question. I was calling the API to remove one product from the HCC db and was getting an error. I am trying to do this from the clients local system when they delete an item but I was getting an error from the API and I wanted help with the error. I prefer to do this remotely from the clients system and in C# rather than JavaScript because I have no experience in JavaScript. At some point, it seems as though Adrian was saying that I had to do this from a program hosted on the web site and I was trying to see if that was really the case.





New Member






--
10/27/2017 1:39 PM
Will/Adrian,

To try to clarify things, I am reposting the question along with the error that was returned.

Following the HCC API docs here: [url=https://hotcakescommerce.zendesk.com/hc/en-us/articles/208407743-ProductInventoryDelete-Endpoint]Docs to delete product[/url] I was trying to delete an inventory product from the web site using C# code. I am running it from the local server on the clients network, not the web hosting site.
I have triple checked the url and key. I am also able to do simple things like get a count of products in the store and search for a product by productID. Here is the code that failed:

[code=csharp]namespace BestTestSQLConnectApp
{
class Program
{
static void Main(string[] args)
{
string hotcakesURL = "http://MyActualSite.com";
string hotcakesKey = "MyActualKey";
Api hotcakesProxy = new Api(hotcakesURL, hotcakesKey);
}
var inventoryId = "3A855F7A-3A2E-44CA-AE5C-AA2014B61018";
// call the API to delete the product inventory record
Hotcakes.CommerceDTO.v1.ApiResponse response = hotcakesProxy.ProductInventoryDelete(inventoryId);[/code]

Here is the error that was returned:

"Error SendRequest: The remote server returned an error: (405) Method Not Allowed. System | at Hotcakes.CommerceDTO.v1.Client.RestHelper.SendRequest(String serviceUrl, String method, String data, WebProxy proxy, Int32 timeout)\r\n at Hotcakes.CommerceDTO.v1.Client.RestHelper.SendWithData[T](String uri, String method, String data)"





New Member






--
10/31/2017 11:55 AM
So, can anyone tell me what the error is? Or, can you tell me if I can call the C# program from my local machine? I have tried several API calls and some work but this one to delete a product never does.
You are not authorized to post a reply.
Page 4 of 5 << < 12345 > >>


Loading
  • Sign-up for the Hotcakes Community Newsletter: