Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Update Product Via Rest Api Rate Topic   - - - - -

 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 02 July 2019 - 07:03 AM #1

Hello,

 

I try to update a product via REST API using the url http://example.com/api/products/:id as mentioned here .

 

I am using the PUT method but I am getting

 

405 Method Not Allowed

The requested method PUT is not allowed for the URL /api/stores/1/products/27

 

I am trying from Postman, and creating or getting products works fine. What could go wrong?

 



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 800 posts

Posted 02 July 2019 - 12:56 PM #2

Hello

 

http://your_host/api...ucts/product_ide.g

 

http://csul/4101a/api/products/17

 

You can set Basic Autorization admin_login_email:API_KEY

 

You can set PUT method

 

Body set on "raw" and set JSON (application/json)

 

And in body add e.g.

{"product": "test"} or  {"amount": "1000"} or other

 

and click "Send"

 

See screenshot

 

Best regards

Robert

Attached Files


Team of SoftSolid
cs-cart.pl

 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 03 July 2019 - 05:15 AM #3

Hello, thank you for your answer.
The problem is that I am doing exactly that. In other cases (post, get) I have no such problems....

 

You can see it in the following screenshots

 

Attached File  Screenshot 2019-07-03 at 08.05.52.jpg   65.79KB   1 downloads

 

Attached File  Screenshot 2019-07-03 at 08.08.png   334.72KB   1 downloads



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19589 posts

Posted 03 July 2019 - 05:51 AM #4

Please make sure that the Manage catalog permission is not disabled for the used account


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 03 July 2019 - 06:32 AM #5

Where is this setting Robert? I cannot find it.



 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 03 July 2019 - 07:11 AM #6

Under "Customers-> User groups" the admin (where this user belongs to) as access to everything.

 

But after all why only this PUT command fails? Every other command works



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 800 posts

Posted 03 July 2019 - 07:47 AM #7

Hello

 

Please try remove from url "stores/1" and try again

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 03 July 2019 - 08:25 AM #8

I am afraid I tried this and the problem remains the same :(

 

Attached File  Screenshot 2019-07-03 at 11.23.06.jpg   57.38KB   1 downloads



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 800 posts

Posted 03 July 2019 - 08:45 AM #9

Hello

 

Can you put a devel version of your store so that you can do tests on it ?

I understand that you have set api authorization correctly?

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 03 July 2019 - 09:34 AM #10

Yes I have a develop version online. Do you want me to send you in a private message access to take a look?



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 800 posts

Posted 03 July 2019 - 09:45 AM #11

Hello

 

Yes. Sent me PM.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • abinop
  • Member
  • Members
  • Join Date: 01-Apr 07
  • 57 posts

Posted 04 July 2019 - 06:09 AM #12

The problem was that Apache did not support PUT and DELETE. As soon as we enabled them everything worked as expected.