cURL
JavaScript
Python
PHP
C#
curl \
- H "Authorization: Bearer API_KEY" \
- H 'Content-Type: application/json' \
- d '{"domain": "ACME", "privateKey": "-----BEGIN RSA PRIVATE KEY...", "profileKey": "PROFILE_KEY"}' \
- X POST https : / / api. ayrshare . com / api/ profiles/ generateJWT
200: Success
400: Private Key Formatted Incorrectly
{
"status" : "success" ,
"title" : "User Profile Title" ,
"token" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlLZXkiOiJBSjNQR1cxLThIWk04UjQtR0NXVFZKVy1ZRTE1M1BFIiwicHJvZmlsZUtleSI6IjhKNDY4UFktSjM5TVlXRC1IWEpLVlIyLVBRMjBQUlMiLCJpYXQiOjE2MTQyMjYwNDksImV4cCI6MTYxNDIyNjM0OSwiYXVkIjoiaHR0cHM6Ly9hcHAuYXlyc2hhcmUuY29tIiwiaXNzIjoiYm9uZGJyYW5kbG95YWx0eS5jb20iLCJzdWIiOiJzdXBwb3J0QGF5cnNoYXJlLmNvbSJ9.Se387OyhJIdaDkFkvAe0Dwo3pQrHBwdg2bbjqKYn7BZuVDxPboJmTsd7rra8N-Z6b9_fJOtwlRFGBLW1CvgLGU4RSisTVqjqhAkb3KNhpA7cZ673IJbRX-ST7tYadKKzmd9GNrZW9rhxHOlgMJ9uOboc4dcaDbNmzb_yCrfLY-E"
"url" : "https://profile.ayrshare.com?domain=PROVIDED_DOMAIN&jwt=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlLZXkiOiJBSjNQR1cxLThIWk04UjQtR0NXVFZKVy1ZRTE1M1BFIiwicHJvZmlsZUtleSI6IjhKNDY4UFktSjM5TVlXRC1IWEpLVlIyLVBRMjBQUlMiLCJpYXQiOjE2MTQyMjYwNDksImV4cCI6MTYxNDIyNjM0OSwiYXVkIjoiaHR0cHM6Ly9hcHAuYXlyc2hhcmUuY29tIiwiaXNzIjoiYm9uZGJyYW5kbG95YWx0eS5jb20iLCJzdWIiOiJzdXBwb3J0QGF5cnNoYXJlLmNvbSJ9.Se387OyhJIdaDkFkvAe0Dwo3pQrHBwdg2bbjqKYn7BZuVDxPboJmTsd7rra8N-Z6b9_fJOtwlRFGBLW1CvgLGU4RSisTVqjqhAkb3KNhpA7cZ673IJbRX-ST7tYadKKzmd9GNrZW9rhxHOlgMJ9uOboc4dcaDbNmzb_yCrfLY-E" ,
"emailSent" : true ,
"expiresIn" : "30m"
}
Available on Business, Enterprise plans.
Generate a JSON Web Token (JWT) for use with single sign on.
See the Generate JWT Overview for more details.
The JWT URL is valid for 5 minutes . After 5 minutes you must generate a new JWT URL.
See the Max Pack expireIn
for additional options .
API Key of the Primary Profile.
Format:
Authorization: Bearer API_KEY
Body Parameters
Domain of app. Please use the exact domain given during onboarding.
Private Key used for encryption.
User Profile Key. The API Key cannot be used in this field.
Specify a URL to redirect to when the “Done” button or logo image is clicked. The URL will be automatically shortened in the returned JWT url. Redirect the origin opener window by adding the query parameter origin=true
to the redirect URL.
If the private key is base64 encoded, set to true
.
Encode the private.key file in base64 and pass the single line String in the privateKey
field.
E.g in Linux: cat private.key | base64
Set the longevity of the token in minutes. Range: 1 minute to 2880 minutes.
See JWT Expire In for more information.
Send a Connect Accounts email with a link for users to directly access their social linkage page.
See Connect Accounts Email for more information.
cURL
JavaScript
Python
PHP
C#
curl \
- H "Authorization: Bearer API_KEY" \
- H 'Content-Type: application/json' \
- d '{"domain": "ACME", "privateKey": "-----BEGIN RSA PRIVATE KEY...", "profileKey": "PROFILE_KEY"}' \
- X POST https : / / api. ayrshare . com / api/ profiles/ generateJWT
200: Success
400: Private Key Formatted Incorrectly
{
"status" : "success" ,
"title" : "User Profile Title" ,
"token" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlLZXkiOiJBSjNQR1cxLThIWk04UjQtR0NXVFZKVy1ZRTE1M1BFIiwicHJvZmlsZUtleSI6IjhKNDY4UFktSjM5TVlXRC1IWEpLVlIyLVBRMjBQUlMiLCJpYX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