function submit_request(){ var target = { "type": "SIDEREAL", "name": "M42", "ra": 83.8220792, "dec": -5.3911111, "proper_motion_ra": 1.67, "proper_motion_dec": -0.3, "parallax": 0.0, "coordinate_system": "ICRS", "equinox": "J2000", "epoch": 2000.0, "rot_mode": "VFLOAT", "rot_angle": 0.0 } var molecules = [ { "type": "EXPOSE", "instrument_name": "0M4-SCICAM-SBIG", "filter": "rp", "exposure_time": 30.0, "exposure_count": 1, "bin_x": 2, "bin_y": 2, "defocus": 0.0, } ] var timewindow = { "start": "2017-08-07 00:00:00", "end": "2017-08-14 00:00:00" } var request = { "location":{"telescope_class":"0m4"}, "constraints":{"max_airmass":1.6}, "target": target, "molecules": molecules, "windows": [timewindow], "observation_note" : "Serol", "type":"request" } var data = { "group_id": "sxe_201708_001", "proposal": "LCOEPO2014B-010", "ipp_value": 1.05, "operator": "SINGLE", "observation_type": "NORMAL", "requests": [request], } console.log(data) $.ajax({ url: 'https://observe.lco.global/api/userrequests/', type: 'post', data: data, headers: {'Authorization': 'Token '}, dataType: 'json', success: function(data){ console.log(data); } }); }