-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP 400 Error using getNotifications() #350
Comments
Even if I manually use the URL https://steamcommunity.com/actions/GetNotificationCounts which getNotifications() uses in my own browser, I get a 400 bad request (with steam logged in). |
is there anyone who has the same problem? |
I think Steam deactivated this endpoint. It currently uses the new API method: const baseURL = "https://api.steampowered.com/ISteamNotificationService/GetSteamNotifications/v1";
const inputJson = {
include_hidden: false,
language: 0,
include_confirmation_count: false,
include_pinned_counts: true,
include_read: false,
count_only: false,
};
const url = new URL(baseURL);
url.searchParams.set("access_token", YOUR_PERSONAL_WEB_ACCESS_TOKEN_HERE);
url.searchParams.set("origin", "https://steamcommunity.com");
url.searchParams.set("input_json", JSON.stringify(inputJson));
const response = await fetch(url.toString(), {
"credentials": "omit",
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
"Priority": "u=4"
},
"referrer": "https://steamcommunity.com/",
"method": "GET",
"mode": "cors"
});
const json = await response.json();
console.log(json);
/*
{
"response": {
"notifications": [
{
"notification_id": "90832180423",
"notification_targets": 3,
"notification_type": 3,
"body_data": "{\"owner_steam_id\":\"103582791435030951\",\"bclan_account\":1,\"forum_id\":\"611696927926638786\",\"topic_id\":\"591759409446669228\",\"thread_id\":\"540414364\",\"type\":\"7\",\"account_id\":68197038,\"subscribed\":0,\"last_post\":1735903167,\"text\":\"Public Forum\",\"title\":\"Comment page for Recent Removals Week 1 2025\",\"bhas_friend\":0,\"bis_forum\":1,\"bis_owner\":0,\"cgid\":\"0\"}",
"read": false,
"timestamp": 1735903167,
"hidden": false,
"expiry": 0,
"viewed": 1735910535
},
{
"notification_id": "90834276217",
"notification_targets": 3,
"notification_type": 5,
"body_data": "{\"requestor_id\":1487476470,\"state\":2}",
"read": false,
"timestamp": 1735905289,
"hidden": false,
"expiry": 0,
"viewed": 1735910535
}
],
"pending_gift_count": 0,
"pending_friend_count": 1,
"unread_count": 2,
"pending_family_invite_count": 0
}
}
*/ Unfortunately, |
Thanks for your help! As far as i know, is the web access token included in the Cookies. Could node-steamcommunity get the Access Token from there? |
If that's true, then yes. |
I've just gone through your suggestion again. Could it be that the proposed endpoint contains significantly less information? |
If it's possible currently in Steam, then yes. |
Using the getNotifications() method gives me an HTTP Error 400.
My code is this (only intended for rough functionality testing):
But i seem to be logged in, because the module successfully displays the tradeurl of the account on the console, which is only executed inside the loggedIn Method.
The text was updated successfully, but these errors were encountered: