Integrate the opencart website to ERPNext with the rest API

Hi, I am Huangxiaoxuan.
I am new to develop the ERPNext Rest API.
I have an Opencart website and want to post all data in Opencart to ERPNext.
At first, I was trying to post the item group using the rest API.
Post: /api/resource/Item%20Group

This is my code:

<?php //******************** LOGIN REQUEST ********************************// $url= 'https://own.erpnext.com/api/method/login'; // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_POSTFIELDS,array( 'usr'=>'username', 'pwd'=>'password')); // Execute post $result = curl_exec($ch); // Close connection curl_close($ch); //******************** DOCUMENT CREATE REQUEST ******************************// $response= json_decode($result,true); if($response['message']=='Logged In'){ // Create lead.................................// $url = 'https://own.erpnext.com/api/resource/Item%20Group'; // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_POSTFIELDS,array( 'data' => '{"name":"HuangXiaoxuan"}' )); // Execute post $result = curl_exec($ch); // Close connection curl_close($ch); echo $result; } ?>

but it doesn’t works.
Error : “Not Permitted”
I was trying to find the proper solutions in this website articles, but I didn’t solve this issue.
If someone is good at this issue, help me.