Skip to main content
===================
Facebook Token
===================

# Install
pip install facebooktoken

# Prepare your necessary varibles
1. Visit https://developers.facebook.com/tools/explorer/ and retrieve your short lived access token
2. Visit https://developers.facebook.com/apps/ and retreive your **APP ID** and **APP SECRET**

# Use your retrieved variables
```python
from facebooktoken import FacebookTokenRefresher

ftr = FacebookTokenRefresher(
app_id=700797440051611,
app_secret="485c92c8220b87badbe8f6bb5cd02be7",
short_access_token="EAAJ9Xx55SZA0BAHmtrLHE3mvthKHW5mbBDXpkW6haI62UBevj8bZB1DWdoGKKtYhevbZBvtyOBHVdC7i3cFmxbO7PaUpjS2yovRO4BWPsNcmRqLzUCcAcU70dkl3WrdrqZAvG1jPWrdcnVJZANKiZCJmqf44vXfNU9kAzA9uqRM0FTzYZBk6P6QYlpQJ2LJiNQZD"
)

results = ftr.refresh()
```

### Results with status code 200
```json
{
'access_token': 'EAAJ9Xx55SZA0BAKt4QswTRq7CFx0V4a9Ria1DrOlP36rtyJDUZAOmIdMaO7LZBTInDUaN7jnIgckxwy5FYApzqrpYYhbM5rsBSzx9TLZAdKrFk9BRDCw6foj07dEYkQhbPq8TYYeRYqDeLutgwB4hbVyYSes43AZD',
'expires': u'5179894'
}
```

## On failure
By default on failure FacebookTokenRefresherException will get raised with the response data. You could if needed pass raise_exception=False when using the *refresh()* method.

### Results on failure with execption raised (Exception)
```python
facebooktoken.base.FacebookTokenRefresherException: {
"error": {
"message": "Invalid Client ID",
"code": 101,
"type": "OAuthException",
"fbtrace_id": "EYsYDFbxVAm"
}
}
```

### Results on failure without execption raised (Dictionary)
```json
{
"error": {
"message": "Invalid Client ID",
"code": 101,
"type": "OAuthException",
"fbtrace_id": "DFbQ8aA94t5"
}
}
```

Metadata

Release files for facebooktoken 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facebooktoken 0.0.1
File Size Uploaded Provenance Actions
facebooktoken-0.0.1.tar.gz 3.2 kB Without provenance Details for facebooktoken-0.0.1.tar.gz

Release files / facebooktoken-0.0.1.tar.gz

Download URL facebooktoken-0.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
15283aa5b7ff4f654f7ba1c1af47b8264bbe48af75df76d9df94bcc0a2aa5160
BLAKE2b-256 checksum
How to use checksums
5d589dcca39c5f9c754096e39a47b4b0e72c3bf19225a5ee0b9e39d16e9bcdff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for facebooktoken 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page