skip to Main Content

Encountering json decode error with python

So I needed help because my json is wrong and I need to fix it with the code itself. The JSON is : {"3704969059":{"Lunar Moth Headwings",100,1680750150,500,"https://tr.rbxcdn.com/5c0a02da770746e4ac9a1760d427f716/150/150/Hat/Png"},"13114264635":{"Cow Beret",70,1682603172,200,"https://tr.rbxcdn.com/7d39a32f04f00844113f4b3ab355517a/150/150/Hat/Png"},"13160317604":{"Insignia Helmet",2500,1682593511,25,"https://tr.rbxcdn.com/55feabd27486feb51eb4f0db2209fecf/150/150/Hat/Png"}} The error is json.decoder.JSONDecodeError: Expecting ':' delimiter: line 1 column 38 (char…

VIEW QUESTION

Json – How can i get the info from api request into an object

When i use the following: using (HttpResponseMessage response = client.GetAsync(postMethod.ToString()).Result) { if (response.IsSuccessStatusCode) { var Json = response.Content.ReadAsStringAsync().Result; Console.WriteLine(Json); var y = JsonSerializer.Deserialize<PersonInfoJson>(Json); Console.Write("r= " + y.requester); Console.Write("id= " + y.id); } } The json returned is {"requesters":[{"active":true,"address":null,"background_information":null,"can_see_all_changes_from_associated_departments":false,"can_see_all_tickets_from_associated_departments":false,"created_at":"2022-12-15T21:07:22Z","custom_fields":{"blah_id":"00002342"},"department_ids":[1111111],"department_names":["Student"],"external_id":null,"first_name":"mike","has_logged_in":false,"id":123456,"is_agent":false,"job_title":null,"language":"en","last_name":"ishere","location_id":null,"location_name":null,"mobile_phone_number":"111-111-1111","primary_email":"[email protected]","reporting_manager_id":null,"secondary_emails":["[email protected]"],"time_format":"12h","time_zone":"Eastern Time (US…

VIEW QUESTION
Back To Top
Search