Skip to content
Jeff Johns edited this page Jan 31, 2014 · 8 revisions

All the data for any view can easily be found if you are an admin by adding ?debug=1 to the end of any url. We will try our best to keep the below up-to-date by view.

All web view requests

All web view requests will always have the following data. However, you should ALWAYS make sure a variable exists before trying to use it.

Key Type Description
csrf_token String The current user's CSRF token.
errors Array An array with any errors and error numbers/codes as the key. This will **ONLY** be present if there is an error or warning. The key is the error code and the value is the message.
flash_message Array An array with type and message if there are any flash messages to show on the current page.
flash_message['type'] String Will always be `error` or `success`.
flash_message['message'] String The flash message.
labels Array An array of all the system level static labels.
labels[x].label_id Integer The label id.
labels[x].name String The label name.
labels[x].slug String The label slug used for urls and/or lookups.
labels[x].active Integer 1 = active, 0 = inactive.
labels[x].type String The type of label (possible values overall are label or smart).
labels[x].total_marks Integer The total active marks for the user under that label.
logged_in Boolean True = logged in, false = no.
lookup_type String The type of lookup requested. (all, archive, search, today, yesterday, last-week, last-month, last-three-months, last-six-months, last-year, ages-ago, label, tag or custom_date)
stats Array An array of statistics for the current user.
stats[x].saved Array An array of stats for all saved marks.
stats[x].saved.today Array Total marks saved today.
stats[x].saved.yesterday Array Total marks saved yesterday.
stats[x].saved.{2 days ago} Array Total marks saved 2 days ago.
stats[x].saved.{3 days ago} Array Total marks saved 3 days ago.
stats[x].saved.{4 days ago} Array Total marks saved 4 days ago.
stats[x].saved.total Array Total marks.
stats[x].archived Array An array of stats for all archived marks.
stats[x].archived.today Array Total marks archived today.
stats[x].archived.yesterday Array Total marks archived yesterday.
stats[x].archived.{2 days ago} Array Total marks archived 2 days ago.
stats[x].archived.{3 days ago} Array Total marks archived 3 days ago.
stats[x].archived.{4 days ago} Array Total marks archived 4 days ago.
stats[x].archived.total Array Total archived marks.
stats[x].marks Array An array of stats for all unarchived marks.
stats[x].marks.today Array Total marks unarchived from today.
stats[x].marks.yesterday Array Total marks unarchived from yesterday.
stats[x].marks.{last week} Array Total marks unarchived from last week.
stats[x].marks.{last month} Array Total marks unarchived from last month.
stats[x].marks.{last 3 months} Array Total marks unarchived from over the last 3 months.
stats[x].marks.{last 6 months} Array Total marks unarchived from over the last 6 months.
stats[x].marks.{last year} Array Total marks unarchived from over the last year.
stats[x].marks.{ages ago} Array Total marks unarchived from more than a year ago.
stats[x].archived.total Array Total unarchived marks.
tags Array An array of tags for the user's most popular and recent tags.
tags[popular|recent] Array An array of popular or recent tags.
tags[popular|recent][x].tag_id Integer The tag id.
tags[popular|recent][x].total Integer The total marks that use this tag for the current user.
tags[popular|recent][x].name String The tag name.
tags[popular|recent][x].slug String The tag slug.
user Array An array with any user information. Will only be valid for logged in users.
user['user_id'] Integer The user's id.
user['user_token'] String The user's security token they can use for API calls.
user['active'] Integer 1 = active, 0 = inactive.
user['admin'] Boolean true = admin, false = normal user.
user['email'] String The user's email address.

Lookup Pages

The following data is shown for all response types when requesting marks, tags or labels; no matter the lookup type.

Key Type Description
page Integer The current results page you are viewing. Only shown if total >= 1.
pages Integer The total pages the lookup has. Only shown if total >= 1.
per_page Integer How many results are being shown per page. Only shown if total >= 1.
total Integer The total results for the current lookup. Always shown.

Route: /marks?/*

The following data is shown on all mark requests, no matter the lookup type or response type. If you call a plural URL the result will be an array of marks with the key saying marks. If you are updating, deleting or doing anything else to a single mark the response will be a single object with no array.

Many Example

// URL: /marks
{
    marks: {
        0: {
            mark_id: MARK_ID,
            ...
        },
    };
}

Singular Example

// URL: /mark/delete/MARK_ID
{
    mark_id: MARK_ID,
    ...
}
Key Type Description
marks Array An array of marks for the current lookup. Will only be present if total > 0. If 0, the error key will be found.
marks[x].mark_id Integer The mark id.
marks[x].notes String The notes for this mark. Hashtags will be automatically linked.
marks[x].created_on Datetime The date and time the mark was created (EST).
marks[x].archived_on Datetime The date and time the mark was archived (EST). NULL if not archived.
marks[x].title String The title of the mark.
marks[x].url String The URL of the mark.
marks[x].embed String If an embed was found, the HTML will be listed here.
marks[x].label_id Integer The label id associated to this mark.
marks[x].label_name String The label name associated to this mark.
marks[x].tags Array An array of tags associated to this mark.
marks[x].tags['slug'] Array The data for the specific tag.
marks[x].tags['slug']['tag_id'] Integer The tag id.
marks[x].tags['slug']['name'] String The tag name.
marks[x].tags['slug']['slug'] String The tag slug.
marks[x].nice_time String A nice, readable way to view the time the mark was created. IE: 10 hours ago.

Route: /marks/label/{LABEL_SLUG OR LABEL_ID}

The following data is shown on all label lookup pages.

Key Type Description
active_label Array An array the current label being looked up. Only return for web views.
active_label['label_id'] Integer The current label_id.
active_label['label_name'] String The current label's name.
labels[x].current Boolean True if current, false if not.

Route: /marks/tags/{TAG_SLUG OR TAG_ID}

The following data is shown on all tag lookup pages.

Key Type Description
tags[popular|recent][x].current Boolean True if current, false if not.