MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "5": {
                "pageid": 5,
                "ns": 0,
                "title": "API",
                "revisions": [
                    {
                        "user": "Erik",
                        "timestamp": "2023-06-15T21:05:55Z",
                        "comment": "",
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "== Overview ==\n=== Getting Started ===\n* First you'll need to authenticate the device you are using.\n* Even though each TimeMD account has a unique \"Access URL\" (or \"Client URL\"). You'll use our dedicated API URL for all calls to the server. In this case the URL is \u2018login.timemd.com\u2019.\n=== What You Should Know First ===\n* TimeMD.com uses a REST interface for our API. [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] is a simple format that allows you to make queries by constructing a URI containing variables and values and submitting to our API web page. The server responds with [http://en.wikipedia.org/wiki/XML XML] or [http://en.wikipedia.org/wiki/JSON JSON] output containing the information that you requested.\n* Each API request is composed of two parts. An action and variables for that action. Additionally, all API calls (with the exception of register_device) require an api_key parameter that proves you are logged in. Normally you won't have to worry about this though, since our PHP class handles authentication for you.\n* All API output is returned in JSON format unless you add the output_format=xml option to your requests. All API requests will include a status field with a value of either \u2018ok\u2019 or \u2018fail\u2019. If the status is 'ok' there will also be a field named \u2018message\u2019 with more details. If the status is 'fail' there will also be an element named 'message' with more details.\n* We recommend using HTTPS for all API requests to our Access URL\n* GET vs. POST. Our API reads your actions and parameters from both GET and POST data. While examples below show parameters being posted via GET, it will work equally well if some (or all) of the parameters are passed as POST data.\n\n== API Actions ==\nTo register a device, your first login with a company's primary account login. You must pass the action \u2018regiser_device\u2019, and you must include the company's username and password:\n\nIn return you will get the accounts API Key. You must include the given key for all subsequent API calls related to that device (i.e. clock_out, clock_in, etc.) See \"Authentication\" section below for more information regarding the action, \"register_device\".\n\n<pre>\n<result>\n <status>ok</status>\n <message>The device has been successfully registered</message>\n <api_key>28150_1536687004</api_key>\n</result>\n</pre>\n\nWhen you receive a status of 'fail' from any API action, you'll also be given a message. For example:\n\n<pre>\n<result>\n   <status>fail</status>\n   <message>Login credentials not recognized</message>\n</result>\n</pre>\n\nWhen you receive a status of 'followup' from any API action, you'll also be given a message to display to the user. For example:\n\n<pre>\n<result>\n   <status>followup</status>\n   <message>Where you injured on the job today?</message>\n</result>\n</pre>\n\n==  Authentication ==\n=== Registering A Device ===\nThis is required before any subsequent API actions can be placed. Upon successful authentication, you will receive the accounts API Key. This should be saved on the device.\n\n<b>Action</b>\n* register_device\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| username\n| Yes\n| The username of the account to be registered.\n|-\n!scope=\"row\"| password\n| Yes\n| The password of the account to be registered.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why. On 'ok', the action will also return the API Key which is required for all subsequent action calls.\n\n== Tracking Time ==\n=== Clocking In ===\nUsually called ''Clocking-in', ''punching the clock'' or ''starting a timer'', this call lets you start tracking time for a user.\n\n<b>Action</b>\n* clock_in\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| user_idx\n| Yes\n| The TimeMD assigned ID of the user you would like to click in with.\n|-\n!scope=\"row\"| dept_idx\n| Maybe\n| The TimeMD assigned ID of the department the user is to be clocked in under. If this parameter is not passed, the system will assume the primary department is being used.\n|-\n!scope=\"row\"| job_idx\n| Maybe\n| The TimeMD assigned ID of the job the user is to be clocked in under. If this parameter is not passed, the system will assume the primary job is being used \u201cIf\u201d job tracking is required.\n|-\n!scope=\"row\"| task_idx\n| Maybe\n| The TimeMD assigned ID of the taks the user is to be clocked in under.\n|-\n!scope=\"row\"| photo_bin\n| Maybe\n| The binary data of the photograph taken during the clock_in action. This is required on devices with a camera.\n|-\n!scope=\"row\"| gps_lat\n| Maybe\n| The latitude coordinate of the device if available and if the client has requested for GPS tracking coordinates.\n|-\n!scope=\"row\"| gps_lon\n| Maybe\n| The longitude coordinate of the device if available and if the client has requested for GPS tracking coordinates.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why.\n\n=== Clocking Out ===\nClock out a user. Also called ''punching out'' or ''stopping a timer''.\n\n<b>Action</b>\n* clock_out\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| time_idx\n| Yes\n| The TimeMD assigned ID of the time entry the user is clocking out from.\n|-\n!scope=\"row\"| dept_idx\n| Yes\n| The TimeMD assigned department ID. If different then the department ID saved to existing time entry, system will automatically clock user in under the new ID.\n|-\n!scope=\"row\"| job_idx\n| Maybe\n| The TimeMD assigned job ID. If passed and if different then the job ID saved to time entry, system will automatically clock user in under the new ID.\n|-\n!scope=\"row\"| task_idx\n| Maybe\n| The TimeMD assigned task ID. If passed and if different then the task ID saved to time entry, system will automatically clock user in under the new ID.\n|-\n!scope=\"row\"| photo_bin\n| Maybe\n| The binary data of the photograph taken during the clock_out action. This is required on devices with a camera.\n|-\n!scope=\"row\"| gps_lat\n| Maybe\n| The latitude coordinate of the device if available and if the client has requested for GPS tracking coordinates.\n|-\n!scope=\"row\"| gps_lon\n| Maybe\n| The longitude coordinate of the device if available and if the client has requested for GPS tracking coordinates.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why.\n\n=== Starting A Break ===\nThis call lets you start a break for a user.\n\n<b>Action</b>\n* start_break\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| user_idx\n| Yes\n| The TimeMD assigned ID of the user you would like to start a break with.\n|-\n!scope=\"row\"| time_idx\n| Yes\n| The TimeMD assigned ID of the time entry the user is starting their break from.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail''. On 'fail' a ''message'' field will explain why.\n\n=== Ending A Break ===\nThis call lets you start a break for a user.\n\n<b>Action</b>\n* end_break\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| user_idx\n| Yes\n| The TimeMD assigned ID of the user you would like to end a break with.\n|-\n!scope=\"row\"| time_idx\n| Yes\n| The TimeMD assigned ID of the time entry the user is ending their break from.\n|-\n!scope=\"row\"| time_break_idx\n| Yes\n| The TimeMD assigned ID of the break entry the user is ending from.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail''. On 'fail' a ''message'' field will explain why.\n\n== Data Management ==\n=== Adding Users ===\nUsed to add new employees to your account.\n\n<b>Action</b>\n* custom_add_employee\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details\n|-\n!scope=\"row\"| employee_id\n| Yes\n| The Employee ID of the employee being added\n|-\n!scope=\"row\"| first_name\n| Yes\n| First name of the employee\n|-\n!scope=\"row\"| last_name\n| Yes\n| Last name of the employee\n|-\n!scope=\"row\"| cell_number\n| Yes\n| Cell number for the employee. Format (123)456-7890\n|-\n!scope=\"row\"| employee_status\n| Yes\n| Employee status. 1 = Active. 0 = Inactive\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why. On 'ok', the action will also return the API Key which is required for all subsequent action calls.\n\n=== Updating Users ===\nUsed to add update employees.\n\n<b>Action</b>\n* custom_update_employee\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details\n|-\n!scope=\"row\"| employee_id\n| Yes\n| The Employee ID of the employee being updated\n|-\n!scope=\"row\"| first_name\n| No\n| First name of the employee\n|-\n!scope=\"row\"| last_name\n| No\n| Last name of the employee\n|-\n!scope=\"row\"| cell_number\n| No\n| Cell number for the employee. Format (123)456-7890\n|-\n!scope=\"row\"| employee_status\n| No\n| Employee status. 1 = Active. 0 = Inactive\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why. On 'ok', the action will also return the API Key which is required for all subsequent action calls.\n\n=== Adding Locations ===\nUsed to add new locations.\n\n<b>Action</b>\n* custom_add_location\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details\n|-\n!scope=\"row\"| location_id\n| Yes\n| The Location ID of the location being added\n|-\n!scope=\"row\"| location_name\n| Yes\n| Name of the location\n|-\n!scope=\"row\"| location_time_zone\n| No\n| Time zone of the location\n|-\n!scope=\"row\"| location_address1\n| No\n| Address of the location\n|-\n!scope=\"row\"| location_address2\n| No\n| Address of the location\n|-\n!scope=\"row\"| location_city\n| No\n| City of the location\n|-\n!scope=\"row\"| location_state\n| No\n| State of the location\n|-\n!scope=\"row\"| location_zip\n| No\n| Zip of the location\n|-\n!scope=\"row\"| location_geo_address\n| No\n| GPS full address of the location in the following format: street, city, state, zip, country\n|-\n!scope=\"row\"| location_geo_lat\n| No\n| Latitude of the location in decimal form\n|-\n!scope=\"row\"| location_geo_lon\n| No\n| Longitude of the location in decimal form\n|-\n!scope=\"row\"| location_geo_radius\n| No\n| Geo fence radius of the location\n|-\n!scope=\"row\"| location_geo_active\n| No\n| Status of the geo fence: 1 = Active, 0 = Inactive\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why. On 'ok', the action will also return the API Key which is required for all subsequent action calls.\n\n=== Updating Locations ===\nUsed to update an existing locations.\n\n<b>Action</b>\n* custom_update_location\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details\n|-\n!scope=\"row\"| location_id\n| Yes\n| The Location ID of the location being updated\n|-\n!scope=\"row\"| location_name\n| Yes\n| Name of the location\n|-\n!scope=\"row\"| location_time_zone\n| No\n| Time zone of the location\n|-\n!scope=\"row\"| location_address1\n| No\n| Address of the location\n|-\n!scope=\"row\"| location_address2\n| No\n| Address of the location\n|-\n!scope=\"row\"| location_city\n| No\n| City of the location\n|-\n!scope=\"row\"| location_state\n| No\n| State of the location\n|-\n!scope=\"row\"| location_zip\n| No\n| Zip of the location\n|-\n!scope=\"row\"| location_geo_address\n| No\n| GPS full address of the location in the following format: street, city, state, zip, country\n|-\n!scope=\"row\"| location_geo_lat\n| No\n| Latitude of the location in decimal form\n|-\n!scope=\"row\"| location_geo_lon\n| No\n| Longitude of the location in decimal form\n|-\n!scope=\"row\"| location_geo_radius\n| No\n| Geo fence radius of the location\n|-\n!scope=\"row\"| location_geo_active\n| No\n| Status of the geo fence: 1 = Active, 0 = Inactive\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail'. On 'fail' a ''message'' field will explain why. On 'ok', the action will also return the API Key which is required for all subsequent action calls.\n\n== Read-Only Information ==\n=== Retrieving Properties ===\nIf you want to retrieve a property for a user, such as clocked_in or full_name, you may do so via the \u201cget\u201d API action. The following parameters are available:\n\n<b>Action</b>\n* get\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| user_idx\n| No\n| If provided, the method will return data specific to that user. If not provided, method will return data specific to the account the API Key belongs too.\n|-\n!scope=\"row\"| device_id\n| No\n| If provided, the method will return data specific to that device. If not provided, method will return data specific to the account the API Key belongs too.\n|-\n!scope=\"row\"| property\n| Yes\n| The property or properties that you would like to retrieve. You may specify multiple properties at once, just provide them separated by a pipe character, without spaces.\n|}\n\n<b>The following properties are available for retrieval via the get action:</b>\n\n==== Account Related Properties ====\n* username (username)\n* fname (fist name)\n* lname (last name)\n* full_name (full name of the user)\n* emp_num (employee number)\n* company_name (company name)\n* messages (any messages that need to be reviewed by the user.)\n* primary_dept (the name of the primary department assigned to the user. If used, the primary_dept_data property is automatically returned.  The following properties are returned by the primary_dept_data property:\n** idx (TimeMD assigned ID)\n** name (name of the department)\n** location (name of the department is assigned too)\n* primary_job (the name of the primary job assigned to the user. If used, the primary_job_data property is automatically returned. The following properties are returned by the primary_job_data property:\n** idx (TimeMD assigned ID)\n** jobIdx (parent job ID)\n** name (name of job)\n** jobId (User assigned job ID)\n* user_perms (permissions assigned to the user, 1 means they have the permission, 0 or blank means they do not). The following properties are returned by the user_perms property. A value of 1 indicates true, a 0 or blank indicates false:\n** timeTracking (whether or not user is authorized to track time)\n** displayJobs (whether or not jobs should be displayed)\n** displayTasks (whether or not tasks should be displayed)\n** autoBreak (whether or not breaks have been automated)\n** autoTrack (whether or not the users time entries have been automated)\n** gpsTrack (whether or not the account has requested GPS tracking)\n* user_data (all data tracked for the user). The following properties are returned by the user_data property:\n** idx (TimeMD assigned ID)\n** user (users username)\n** fstName (users first name)\n** lstName (users last name)\n** email (users email address)\n** status (users status. 10 = Active, 90 = In-active)\n** empNum (users employee number)\n** timeNum (users time clock number)\n** dtHire (date hired in unix time)\n** lastLogin (date last logged into the system in unix time)\n** dtCreated (date users account was created)\n** user_perms (full list of user permissions - only applicable to manager accounts)\n* lang_settings (language settings associated with this users's account). The following properties are returned by the lang_settings property:\n** location (the word for Location)\n** department (the word for Department)\n** job (the word for Job)\n** task (the word for Task)\n** budget (the word for Budget)\n** shift (the word for Shift)\n* all_users (complete list of all active employee accounts)\n* tz (timezone)\n* excessive_time_flag (The value for which if exceeded, the time entry is flagged as possibly tracking too much time.)\n\n==== Time Entry ====\n* clocked_in (whether or not the user is clocked in. If used and if the user is clocked in, the clocked_in_data property is automatically returned.)\n* on_break (whether or not the user is on break. If used and if the user is on break, the on_break_data propert is automatically returned.)\n\n==== Location, Department, Job, and Task Code Lists ====\n* all_locs (complete list of all locations assigned to client account)\n* all_depts (complete list of all departments including their associated location)\n* depts (complete list of all departments assigned to the use who's ID is being passed to the method)\n* all_jobs (complete list of all jobs assigned to client account)\n* jobs (complete list of all jobs assigned to the user who's ID is being passed to the method)\n* all_tasks (complete list of all tasks assigned to client account)\n\n<b>Examples</b>\n* For example, if you want to get the properties fname, lname and clocked_in. Your URL would look like this:\n<pre>\nhttps://login.timemd.com/login/api.php?api_key=XXXXX_1536687004&user_idx=XXXX&property=fname|lname|clocked_in\n</pre>\n\n<b>Output</b>\n* The output will be just the requested properties associated with the User ID passed to the method.\n<pre>\n<result>\n  <status>ok</status>\n  <message>\n    successfully retrieved properties: [fname|lname|clocked_in]\n  </message>\n  <clocked_in>1</clocked_in>\n  <clocked_in_data></clocked_in_data>\n  <fname>Bob</fname>\n  <lname>Smith</lname>\n</result>\n</pre>\n\n== Misc. Actions ==\n=== Acknowledging Messages From Messanger Module ===\nUse this action to acknowledge that a message has been read in order to hide it from appearing again. \n\n<b>Action</b>\n* message_read\n\n<b>Parameters</b>\n{| border=\"1\" cellspacing=\"0\" cellpadding=\"2\"\n|-\n!scope=\"col\"| Parameter\n!scope=\"col\"| Required\n!scope=\"col\"| Description\n|-\n!scope=\"row\"| api_key\n| Yes\n| See Register a Device section for details.\n|-\n!scope=\"row\"| user_idx\n| Yes\n| The ID of the user acknowledging the message.\n|-\n!scope=\"row\"| message_idx\n| Yes\n| The ID of the message being acknowledged.\n|}\n\n<b>Output</b>\n* The ''status'' field will either be 'ok' or 'fail''. On 'fail' a ''message'' field will explain why."
                    }
                ]
            },
            "1": {
                "pageid": 1,
                "ns": 0,
                "title": "Main Page",
                "revisions": [
                    {
                        "user": "Erik",
                        "timestamp": "2012-02-15T15:10:32Z",
                        "comment": "/* Help and Support */",
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "'''TimeMD Help Desk :: Find answers about your time tracking software.'''\n\n\n\n== Help and Support ==\n* [[Quick Start Guide]]<br />New to TimeMD? Everything you need to know to start using your account right away.<br><br>\n* [[TimeMD User Guide]]<br />Our online user guide.<br><br>\n* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration Settings List for Help Desk Area]<br><br>\n* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]<br><br>\n;;\n\n== More Links ==\n* [//www.timemd.com TimeMD Home Page]\n* [//app.timemd.com TimeMD Client Login Page]"
                    }
                ]
            }
        }
    }
}