Skip to content

Commit 896e816

Browse files
committed
Use different scopes.
1 parent 0c458ea commit 896e816

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

quickstart.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function quickstart() {
105105

106106
// Get a specific participant by identifier. We disable 'raiseError' here
107107
// so we can handle the 404 case ourselves.
108-
const participantIdentifier = "YOUR_PARTICIPANT_IDENTIFIER";
108+
const participantIdentifier = "YOUR_PARTICIPANT_IDENTIFIER"
109109

110110
if (participantIdentifier != "YOUR_PARTICIPANT_IDENTIFIER") {
111111
url = `/api/v1/administration/projects/${rksProjectId}/participants/${participantIdentifier}`;
@@ -118,7 +118,8 @@ async function quickstart() {
118118

119119
// NOTE: This piece is only necessary when using MyDataHelps Embeddables in a custom app.
120120
// Most API use cases do NOT require a participant token.
121-
const scopes = "api user/*.read"
121+
// Be sure to request the correct scope(s) for your needs.
122+
const scopes = "Participant:read SurveyAnswers:read"
122123
const participantAccessToken = await getParticipantAccessToken(serviceAccessToken, participant.id, scopes);
123124
console.log(`\nObtained participant access token for ${participant.id}: ${participantAccessToken}`);
124125
}

0 commit comments

Comments
 (0)