๐ Grammarly Integration with Zluri: Set up via API Tokens (REST API calls) - snehilkusum/API-Documentation-Samples GitHub Wiki
This guide helps Zluri administrators integrate Grammarly via the OAuth 2.0 Set up via API Tokens (REST API calls) authentication method. After completing the setup, you'll be able to:
-
๐ Retrieve Grammarly usage data using the Analytics API
-
๐ฅ Manage licenses and user data via the License Management API
-
โ๏ธ Score user-generated documents through the Writing Score API
Before starting, ensure the following:
-
Grammarly Enterprise or Education subscription
-
Admin privileges in Grammarly dashboard
-
Zluri admin account with access to the Integrations panel
-
Log into your Grammarly Admin Panel.
-
Go to:
Organization > OAuth 2.0 Credentials
-
Click Add Credential
-
Name the credential (e.g.,
Zluri Integration
) -
Select the scopes:
-
analytics-api
-
users-api
-
scores-api
-
-
Click Create
-
Copy your Client ID and Client Secret
---
โ ๏ธ Note: Keep these secure. Do not expose them in client-side code.
Use the following curl
command to obtain an Access Token:
curl -X POST https://auth.grammarly.com/v4/api/oauth2/token \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=analytics-api:read users-api:read scores-api:write"
{
"access_token": "YOUR_ACCESS_TOKEN",
"token_type": "bearer",
"expires_in": 3600,
...
}
Use the access_token
in the Authorization header as:
Authorization: Bearer YOUR_ACCESS_TOKEN
Retrieve Grammarly usage statistics for licensed users.
Endpoint:
GET https://api.grammarly.com/ecosystem/api/v2/analytics/users
Example:
curl -X GET \
'https://api.grammarly.com/ecosystem/api/v2/analytics/users?limit=10&date_from=2024-10-01&date_to=2024-10-10' \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Returns usage data like:
- Days Active
- Sessions Count
- Sessions Improved %
- Prompt Count
GET https://api.grammarly.com/ecosystem/api/v1/users
DELETE https://api.grammarly.com/ecosystem/api/v1/users/{userId}
GET https://api.grammarly.com/ecosystem/api/v1/invitees
DELETE https://api.grammarly.com/ecosystem/api/v1/invitees/{inviteeId}
- Create a score request:
POST https://api.grammarly.com/ecosystem/api/v2/scores
{
"filename": "example.docx"
}
- Upload file (within 120 seconds):
curl -T example.docx "<file_upload_url_from_previous_step>"
- Get score results:
GET https://api.grammarly.com/ecosystem/api/v2/scores/{score_request_id}
general_score
correctness
clarity
delivery
engagement
Format | Extension | MIME Type |
---|---|---|
Microsoft Word |
.doc / .docx
|
application/msword , application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
OpenDocument | .odt |
application/vnd.oasis.opendocument.text |
Text | .txt |
text/plain |
Rich Text | .rtf |
application/rtf |
Limit | Value |
---|---|
Max File Size | 4 MB |
Max Text Length | 100,000 characters |
Upload Timeout | 120 seconds |
API Request Rate | 50 req/sec (GET), 10 req/sec (POST) |
Score Retention | 30 days |
Document Retention | โค 24 hours |
Pagination | Use limit and cursor
|
๐ง Use exponential backoff for 429 (Rate Limit Exceeded) responses.
Got questions? Feel free to submit a ticket or contact us directly at [email protected].