Couldn't find this action in -packname-

Hello guys, i’m a new developer of Coda Packs.
Recently, i’ve been trying to develop a pack which integrates Dolibarr CRM with Coda.

I’ve succesfully find my way to connect to its API and get a sync table of products and generate an action to upload new products with data from Coda, but now, im struggling.

I’m trying to update the products from the API, which needs me using the ID of the product on the URL, like "https://webpage/api/index.php/products/id, where ID would be any number.

Im passing the ID on the async function, and putting if in the URL like this

image

But, when i’ve done a table with the button, i’ve found the ID isn’t working:

image

I can’t make it work as much as i’ve tried, could someone enlighten me?

From your screenshots it looks like the actual ids of the products are 4 digits long

In your error code, the URL you passed has an Id of merely “3”

Could you try it again but pass the full 4 digit id string to the end of the URL?

2 Likes

It may be useful to add some logging to your code to see what the various values are before you create your URL. You can read more about logging in Packs here:

I’ve found my way to fix the ID error on the url, even though im not even sure how i did it, but now, i’m finding another problem.


Now it is detecting the ID correctly to the URL, but it’s throwing a 404 error, even if the ID is correct, as it is getting it from the products list that’s been listed. I’m cappable of accessing it via URL and it’s working fine, which makes me confused and i’m not sure what’s failing.

Here’s a screenshot of the API call. If someone could see what’s failing, i’d be thankful.

I’m glad you are making some progress! Your code looks fine, so it must be something to do with your API specifically, and unfortunately I don’t know anything about it. You may want to take a look at the response body of the 404 response, to see if it has any clues:

Another small tip: you can move the API key out of your code by setting up authentication for your Pack:

I’ll try to fix it on the API, thanks for the help anyway!

I did try doing an authenticate, but didn’t get it to work and it’s not completely necessary for the API i’m using, so i dropped it until i had everything else working fine.

1 Like