Package: webfleet-connect
WebfleetConnectPackage to consume WEBFLEET.connect API.The WEBFLEET.connect API connects software appli­ca­tions with the Webfleet fleet management solution. Via WEBFLEET.connect you can enhance the value of all types of business solutions, including routing and scheduling optimization, ERP, Transport Management System (TMS), supply chain planning, asset management, and much more.Check also the version for:rubyjavascriptInstallationInstall it with:$ pip install webfleet-connectUsageimportwebfleet_connectwc=webfleet_connect.create()response=wc.show_object_report_extern()response.to_hash()# [{:objectno=>"858EU4", :objectname=>"YRT-MMD2439", :objectclassname=>"sales", ...webfleet_connect.create()returns a newSessionobject which has the capabilities to request info from the WEBFLEET.connect API.The Webfleet credential are taken from the env variablesWEBFLEET_CONNECT_ACCOUNT,WEBFLEET_CONNECT_USERNAME,WEBFLEET_CONNECT_PASSWORDandWEBFLEET_CONNECT_APIKEY(if you want to know more about env variables checkthis link).If your system needs to work with multiple accounts or you need to specify the credentials dynamically for some other reason, you can do it this way:params={'account':'companyName','username':'dev','password':'VLm5PpiZST6U','apikey':'ZSksD88s-F7Uf'}wc=webfleet_connect.create(params)When you use one of the methods of this gem, like for exampleshow_vehicle_report_extern, this returns aWebfleetConnectResponseobject which you can do:response=wc.show_vehicle_report_extern()response.url()# gets the url to fetch the informtion from WEBFLEET.connectresponse.status_code()# gets the status code of the requeststr(response)# returns the response message as plain text as is returned by WEBFLEET.connectby WEBFLEET.connectresponse.to_hash()# returns the data as a pyhton hash objectThe methods available in this package are the same that are documented in theWEBFLEET.connect docs pagejust changed from cammelCase to snake_case. See below the list of methods.ParamsIn order to add params to a request is as easy as passing a hash of options in the request like:params={'filterstring':'ECO','objectgroupname':'Vehiculos','ungroupedonly':True}response=wc.show_vehicle_report_extern(params)Therangefrom_stringandrangeto_stringcan acceptTimeobjects:fromdatetimeimportdatetime,timedeltastart_date=datetime.now()end_date=start_date+timedelta(days=1)params={'range_pattern':'ud','rangefrom_string':start_date,'rangeto_string':end_date}response=wc.show_event_report_extern(params)Therange_patterncan accept the values:today,yesterday,two_days_ago,three_days_ago,four_days_ago,five_days_ago,six_days_ago,current_week,last_week,two_weeks_ago,three_weeks_ago,floating_week,last_floating_week,two_floating_weeks_ago,three_floating_weeks_ago,current_month,last_month,two_months_ago,three_months_ago,user_defined_range,udparams={'range_pattern':'today'}response=wc.show_event_report_extern(params)Extra configTheSessionobject works with the default configuration:'lang': 'en', 'format': 'json', 'useUTF8': False, 'useISO8601': Falsebut you can change the default configuration when you create the object:credentials={'account':'companyName','username':'dev','password':'VLm5PpiZST6U','apikey':'ZSksD88s-F7Uf'}config={'lang':'de','format':'csv','useUTF8':True}params=credentials|configwc=webfleet_connect.create(params)Methods listMesage queues:create_queue_externdelete_queue_externpop_queue_messages_externack_queue_messages_externObjects:show_object_report_externshow_vehicle_report_externshow_nearest_vehiclesshow_contractsupdate_vehicleshow_object_groupsshow_object_group_objectsattach_object_to_groupdetach_object_from_groupinsert_object_groupdelete_object_groupupdate_object_groupswitch_outputshow_wakeup_timersupdate_wakeup_timersget_object_featuresupdate_contract_infoget_object_can_signalsget_object_can_malfunctionsget_electric_vehicle_dataget_active_asset_couplingsOrders:send_order_externsend_destination_order_externupdate_order_externupdate_destination_order_externinsert_destination_order_externcancel_order_externassign_order_externreassign_order_externdelete_order_externclear_orders_externshow_order_report_externshow_order_waypointsMessages:send_text_message_externclear_text_messages_externshow_messagessend_binary_messagereset_binary_messagesclear_binary_messagesDrivers:show_driver_report_externinsert_driver_externupdate_driver_externdelete_driver_externshow_opti_drive_indicatorshow_driver_groupsshow_driver_group_driversattach_driver_to_groupdetach_driver_from_groupinsert_driver_groupdelete_driver_groupupdate_driver_groupattach_driver_to_vehicledetach_driver_from_vehicleget_driver_rdt_rulesupdate_driver_rdt_rulesAddresses:show_address_report_externshow_address_group_report_externshow_address_group_address_report_externinsert_address_externupdateAddressExterndelete_address_externattach_address_to_group_externdetach_address_from_group_externinsert_address_group_externdelete_address_group_externEvents:show_event_report_externacknowledge_event_externresolve_event_externget_event_forward_configsget_event_forward_config_recipientsinsert_event_forward_configupdate_event_forward_configdelete_event_forward_configTrips and working times:show_trip_report_externshow_trip_summary_report_externshow_tracksupdate_logbookshow_logbookshow_logbook_historyupdate_logbook_modeupdate_logbook_drivershow_working_timesshow_stand_stillsshow_idle_exceptionsget_object_kpisget_driver_kpisget_remaining_driving_times_euMiscellaneous reports:get_charger_connectionsshow_io_report_externshow_acceleration_eventsshow_speeding_eventsshow_digital_input_state_mileageget_charger_connectionsGeocoding and routing:geocode_addresscalc_route_simple_externConfiguration and security:show_settingscreate_sessionterminate_sessionshow_account_order_statesupdate_account_order_stateshow_account_order_automationsupdate_account_order_automationget_account_status_messagesget_status_messagesset_vehicle_configget_vehicle_configset_status_messagesset_account_status_messagesUser management:show_userschange_passwordVehicle maintenance:insert_maintenance_scheduleupdate_maintenance_scheduledelete_maintenance_scheduleshow_maintenance_schedulesshow_maintenance_tasksresolve_maintenance_taskReporting:get_archived_report_listget_archived_reportdelete_archived_reportget_report_listcreate_reportsend_report_via_mailAreas:get_areasinsert_areadelete_areaupdate_areaget_area_pointsget_area_assignmentsinsert_area_assignmentdelete_area_assignmentget_area_schedulesinsert_area_scheduledelete_area_scheduleLINK.connect:send_aux_device_dataget_local_aux_device_configconfigure_local_aux_deviceget_remote_aux_device_configconfigure_remote_aux_deviceremove_remote_aux_device_configclear_aux_device_data_queuereset_aux_device_dataPlugins:insert_external_eventset_external_object_data