Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 2.35 KB

getting_started.rst

File metadata and controls

88 lines (60 loc) · 2.35 KB

Getting Started

Registration

A Credentials that will provide access to API.

If you don't already have a Credentials, click here to become developer.

Attention

If your application is accepted, you will receive an e-mail from Hi-Rez Studios containing your personal Credentials within a few days.

Credentials

To access the API you'll need your own set of Credentials which consist of a Developer ID (devId) and an Authentication Key (authKey).

Here are the Credentials for a sample account:

devId authKey

1004

23DF3C7E9BD14D84BF892AD206B6755C

Note

The same devId and authKey combination should work for API, API and API, across all supported platforms.

Do not request a new, if you already have a Credentials.

Importing

import pyrez
import pyrez.api
from pyrez.api import PaladinsAPI, SmiteAPI, RealmRoyaleAPI
import pyrez.enumerations
import pyrez.models

Creating API object

paladins = PaladinsAPI(options)

#or
smite = SmiteAPI(options)

#or
reamlRoyale = RealmRoyaleAPI(options)
Options can have the following fields:
  • devId () –
  • authKey () –
  • responseFormat (.Format) –
  • sessionId () –
  • storeSession () – Allows Pyrez to read and store sessionId in a .json file.

Sessions

Sessions are created automatically and self-managed by Pyrez so you really don't need to initialise / call this method directly. However, you can set it manually or even request a new Session.

Manually:

paladins = PaladinsAPI(devId=1004,
                      authKey="23DF3C7E9BD14D84BF892AD206B6755C",
                      sessionId="1465AFCA32DBDB800CEF8C72F296C52C")

Requesting a new Session:

paladins = PaladinsAPI(devId=1004, authKey="23DF3C7E9BD14D84BF892AD206B6755C")
session = paladins._createSession()
print(session.sessionId)

>>> '1465AFCA32DBDB800CEF8C72F296C52C'