def callsv2(): if not request.args or not request.args['key'] or request.args['key'] != IOS_API_KEY: abort(401) if request.method == "POST": if not request.json or not 'google_places_id' in request.json or not 'name' in request.json or not 'vicinity' in request.json: abort(400) call = Call(google_places_id=request.json['google_places_id'], name=request.json['name'], vicinity=request.json['vicinity']) if 'ios_device_id' in request.json: call.populate(ios_device_id=request.json['ios_device_id']) try: call.put() return jsonify(call.to_dict()) except CapabilityDisabledError: abort(400)