Issue while inserting item by api

Server Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 67, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 114, in handle
data = json.loads(
File “/usr/lib/python3.5/json/”, line 312, in loads
TypeError: the JSON object must be str, not ‘bytes’
Status: 500

my php code is
case “Item”:
$data = array(‘data’ => array(‘item_code’=>‘Jashan Vinay5’,
‘thumbnail’ =>‘’,
‘show_in_website’ =>‘1’
$ch = curl_init($url.$endpoints.$doctype);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_COOKIEFILE, ‘t1jg.cookie’);
// the rest omitted (see Auth)
$response = curl_exec($ch);
echo $response;

Seems you’re not passing the data in string format

$data = ‘data=’.‘{‘item_code’=>‘Jashan Vinay5’,
‘thumbnail’ =>‘’,
‘show_in_website’ =>‘1’

Don’t send data in array format. Send it in simple key=value format where key is ‘data’ and value will have hash ‘{}’.

can you explain me how to do that in php

ok Solved it

Can you tell me, how you solve it? i have the same problem