Skip to content

App HTTP Routes

AppRouteHttpRequests

Source code in src/bungio/http/routes/app.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class AppRouteHttpRequests:
    request: Callable[..., Coroutine]

    async def get_application_api_usage(
        self,
        application_id: int,
        auth: AuthData,
        end: Optional[datetime] = None,
        start: Optional[datetime] = None,
        *args,
        **kwargs,
    ) -> dict:
        """
        Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

        Warning: Requires Authentication.
            Required oauth2 scopes: ReadUserData

        Args:
            application_id: ID of the application to get usage statistics.
            auth: Authentication information.
            end: End time for query. Goes to now if not specified.
            start: Start time for query. Goes to 24 hours ago if not specified.

        Raises:
            NotFound: 404 request
            BadRequest: 400 request
            InvalidAuthentication: If authentication is invalid
            TimeoutException: If no connection could be made
            BungieDead: Servers are down
            AuthenticationTooSlow: The authentication key has expired
            BungieException: Relaying the bungie error

        Returns:
            The json response
        """

        return await self.request(
            Route(path=f"/App/ApiUsage/{application_id}/", method="GET", auth=auth, end=end, start=start)
        )

    async def get_bungie_applications(self, auth: Optional[AuthData] = None, *args, **kwargs) -> dict:
        """
        Get list of applications created by Bungie.

        Args:
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Raises:
            NotFound: 404 request
            BadRequest: 400 request
            InvalidAuthentication: If authentication is invalid
            TimeoutException: If no connection could be made
            BungieDead: Servers are down
            AuthenticationTooSlow: The authentication key has expired
            BungieException: Relaying the bungie error

        Returns:
            The json response
        """

        return await self.request(Route(path="/App/FirstParty/", method="GET", auth=auth))

get_application_api_usage(application_id, auth, end=None, start=None, *args, **kwargs) async

Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

Requires Authentication.

Required oauth2 scopes: ReadUserData

Parameters:

Name Type Description Default
application_id int

ID of the application to get usage statistics.

required
auth AuthData

Authentication information.

required
end Optional[datetime]

End time for query. Goes to now if not specified.

None
start Optional[datetime]

Start time for query. Goes to 24 hours ago if not specified.

None

Raises:

Type Description
NotFound

404 request

BadRequest

400 request

InvalidAuthentication

If authentication is invalid

TimeoutException

If no connection could be made

BungieDead

Servers are down

AuthenticationTooSlow

The authentication key has expired

BungieException

Relaying the bungie error

Returns:

Type Description
dict

The json response

Source code in src/bungio/http/routes/app.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
async def get_application_api_usage(
    self,
    application_id: int,
    auth: AuthData,
    end: Optional[datetime] = None,
    start: Optional[datetime] = None,
    *args,
    **kwargs,
) -> dict:
    """
    Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

    Warning: Requires Authentication.
        Required oauth2 scopes: ReadUserData

    Args:
        application_id: ID of the application to get usage statistics.
        auth: Authentication information.
        end: End time for query. Goes to now if not specified.
        start: Start time for query. Goes to 24 hours ago if not specified.

    Raises:
        NotFound: 404 request
        BadRequest: 400 request
        InvalidAuthentication: If authentication is invalid
        TimeoutException: If no connection could be made
        BungieDead: Servers are down
        AuthenticationTooSlow: The authentication key has expired
        BungieException: Relaying the bungie error

    Returns:
        The json response
    """

    return await self.request(
        Route(path=f"/App/ApiUsage/{application_id}/", method="GET", auth=auth, end=end, start=start)
    )

get_bungie_applications(auth=None, *args, **kwargs) async

Get list of applications created by Bungie.

Parameters:

Name Type Description Default
auth Optional[AuthData]

Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

None

Raises:

Type Description
NotFound

404 request

BadRequest

400 request

InvalidAuthentication

If authentication is invalid

TimeoutException

If no connection could be made

BungieDead

Servers are down

AuthenticationTooSlow

The authentication key has expired

BungieException

Relaying the bungie error

Returns:

Type Description
dict

The json response

Source code in src/bungio/http/routes/app.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
async def get_bungie_applications(self, auth: Optional[AuthData] = None, *args, **kwargs) -> dict:
    """
    Get list of applications created by Bungie.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Raises:
        NotFound: 404 request
        BadRequest: 400 request
        InvalidAuthentication: If authentication is invalid
        TimeoutException: If no connection could be made
        BungieDead: Servers are down
        AuthenticationTooSlow: The authentication key has expired
        BungieException: Relaying the bungie error

    Returns:
        The json response
    """

    return await self.request(Route(path="/App/FirstParty/", method="GET", auth=auth))