Notification Search GET /api/notifications/search/v1

View your notifications.

This API requires an access token.

The filters used by this API are the same as used for the site /notifications page, so they are lenient and won't tell you if anything is wrong. Therefore, make sure you implemented it correctly. Polling this API is acceptable, but try not to more than once every 30 seconds. Important: names and inputs are not escaped, you must escape any html entities yourself.

Documentation

Input
  • token - Your backpack.tf account's access token. (5904cbeb0e2cad7f621c0a85)
  • folder - Notification folder (0: Inbox, 1: Archived)
  • filter - Notification filter (see enum below). Default: 0 (All).
  • since - Only show notifications since this Unix timestamp. Please use this option when polling.
Output
  • message - If the status code is not 2xx, this contains the reason for failure.
  • folder_count - Amount of notifications present in this folder.
  • skip - How many notifications were skipped for the query.
  • page_size - How many notifications fit on one page.
  • notifications - Notifications on this page.
    • notification
      • id - The notification's internal id.
      • sent - Unix timestamp, at which this notification was sent.
      • type - Notification type. See the enum below.
      • from? - If the notification originates from another user, this will be present.
        • steamid - User's SteamID64.
        • name - User's name. Not escaped.
      • url? - URL pointing to the resource mentioned by this API.
      • detail? - An additional detail for the notification. See the enum below.
      • data? - Notification data, if any. Not currently documented.
      • unread? - If set, the notification is unread. Calling the search API will not set it to read, instead you should use the Folder API.

Example Output

Input GET http://backpack.tf/api/notifications/search/v1?filter=4&token=5904cbeb0e2cad7f621c0a85
filter=4&token=5904cbeb0e2cad7f621c0a85
Output
{
    "folder_count": 16,
    "page_size": 60,
    "skip": 0,
    "notifications": [
        {
            "id": "58dfdee838a32f009d454ed8",
            "sent": 1491066600,
            "type": 11,
            "from": {
                "steamid": "76561198070299574",
                "name": "cares"
            },
            "url": "\/classifieds?item=Unlocked+Winter+2016+Cosmetic+Case&quality=6&tradable=1&craftable=-1&australium=-1",
            "data": {
                "listing": {
                    "id": "440_5606033582",
                    "steamid": "76561198070299574",
                    "item": {
                        "id": 5606033582,
                        "original_id": 5586772279,
                        "defindex": 5865,
                        "level": 1,
                        "quality": 6,
                        "inventory": 3221225475,
                        "quantity": 1,
                        "origin": 2,
                        "style": 0,
                        "flag_cannot_craft": true,
                        "attributes": [
                            {
                                "defindex": 731,
                                "value": 1065353216,
                                "float_value": 1
                            },
                            {
                                "defindex": 815,
                                "value": 1,
                                "float_value": 1.4012984643248e-45
                            },
                            {
                                "defindex": 542,
                                "value": 0,
                                "float_value": 0
                            }
                        ],
                        "name": "Non-Craftable Unlocked Winter 2016 Cosmetic Case"
                    },
                    "appid": 440,
                    "currencies": {
                        "keys": 3
                    },
                    "offers": 0,
                    "buyout": 1,
                    "details": "",
                    "created": 1491066600,
                    "bump": 1491325176,
                    "intent": 1
                }
            }
        },
        {
            "id": "58dfdd4238a32f00927ef259",
            "sent": 1491066178,
            "type": 11,
            "from": {
                "steamid": "76561198070299574",
                "name": "cares"
            },
            "data": {
                "listing": {
                    "deleted": 1
                }
            }
        },
        {
            "id": "58dfdd3e38a32f00927ef257",
            "sent": 1491066174,
            "type": 11,
            "from": {
                "steamid": "76561198070299574",
                "name": "cares"
            },
            "data": {
                "listing": {
                    "deleted": 1
                }
            }
        },
        {
            "id": "58dfdbb238a32f009939ac14",
            "sent": 1491065778,
            "type": 11,
            "from": {
                "steamid": "76561198070299574",
                "name": "cares"
            },
            "data": {
                "listing": {
                    "deleted": 1
                }
            }
        }
    ]
}

Empty Folder DELETE /api/notifications/folder/v1

Deletes all notifications in the specified folder.

This API requires an access token.

Documentation

Input
  • token - Your backpack.tf account's access token. (5904cbeb0e2cad7f621c0a85)
  • folder - Notification folder (0: Inbox, 1: Archived). Required.
Output
  • message - If the status code is not 2xx, this contains the reason for failure.
  • modified - How many notifications were deleted by this operation.

Mark Folder Read PATCH /api/notifications/folder/v1

Marks all notifications in the specified folder as read.

This API requires an access token.

Documentation

Input
  • token - Your backpack.tf account's access token. (5904cbeb0e2cad7f621c0a85)
  • folder - Notification folder (0: Inbox, 1: Archived). Required.
Output
  • message - If the status code is not 2xx, this contains the reason for failure.
  • modified - How many notifications were marked as read by this operation.

Delete Notifications DELETE /api/notifications/notification/v1

Deletes the specified notifications.

This API requires an access token.

Documentation

Input
  • token - Your backpack.tf account's access token. (5904cbeb0e2cad7f621c0a85)
  • ids - Comma-delimited list of notification ids (the id attribute in the Notification Search API). Limited to 200 ids per request. Use the folder empty API should you need more.
Output
  • message - If the status code is not 2xx, this contains the reason for failure.
  • modified - How many notifications were deleted by this operation.

Notification Type enum

enum {
    All = -1;
    CommentResponse = 0;
    CommentWarning = 1;
    SuggestionResponseLegacy = 2;
    SuggestionAccepted = 3;
    SuggestionClosed = 4;
    SubscribedItemUpdate = 5;
    ClassifiedDeleted = 6;
    AdminMessage = 7;
    TrustRatingAddedLegacy = 8;
    GroupJoinNag = 9;
    CommentWarningRemoved = 10;
    WatchedListing = 11;
    SuggestionReverted = 12;
    TrustRatingRemoved = 17;
    TrustRatingForOtherRemoved = 18;
    TrustRatingAdded = 19;
    IssueResponse = 20;
    PaymentSuccessful = 22;
    PremiumGiftRecipient = 23;
    PremiumSubscriptionCancelled = 24;
    BanAppealCreationAlert = 25;
    IssueCreated = 26;
    Banned = 27;
    NotificationThreadResponse = 28;
    ClassifiedHidden = 29;
    PromotedListingRemovedNag = 30;
}

Notification Filter enum

enum {
    All = 0;
    Responses = 1;
    Trust = 2;
    Suggestions = 3;
    Subscriptions = 4;
    Issues = 6;
}

Notification Detail enum

enum {
    InvalidNotification = 0;
    ReplyToOwnPriceSuggestion = 1;
    ReplyToPriceSuggestionComment = 2;
    PriceSuggestionClosedBySelf = 3;
    PriceSuggestionClosedBySystem = 4;
    PriceSuggestionClosedByAdmin = 5;
    AllListingsHidden = 6;
    TrustRemovedBySystem = 7;
    TrustRemovedBySubmitter = 8;
    TrustRemovedByAdmin = 9;
    OwnIssue = 10;
    WatchedIssue = 11;
    ErrorLoadingBan = 12;
    AllListingsDeleted = 13;
}