You can run queries on real Scope data using any HTTP compliant client (HTTP Client) or GraphQL integrated development environment (GraphQL IDE). GraphQL IDEs are typically easier to work with because they include docs, syntax highlighting, and validation errors.
In this article
Recommended HTTP Clients & GraphQL IDEs
...
Scope GraphQL Explorer is an instance of GraphiQL (a GraphQL IDE) that is available in-browser at https://cms.scopear.com/api/v3/graphql/explorer.
Note: Scope has temporarily disabled the Explorer until (expected to return ~ Q1 2021'), but you can still use any other client to explore the graph. See Using GraphiQL
Recommended HTTP Clients & GraphQL IDEs.
Using GraphiQL
To use the GraphiQL app, download and install it from https://www.electronjs.org/apps/graphiql .
Configuring GraphiQL
Get an OAuth token.
Launch GraphiQL.
In the upper-right corner of GraphiQL, click Edit HTTP Headers.
In the upper-right corner of the modal dialog, click + Add Header.
In the Key field, enter
Authorization
. In the Value field, enterToken token=<token>
, where<token>
is your generated OAuth token.Click the checkmark to the right of the token to save it.
In the upper-right corner of the modal dialog, click + Add Header.
In the Key field, enter
PrivateAccessCode
. In the Value field, enterToken token=YWRtaW4xMjU6c2VjcmV0MTI1
, whereYWRtaW4xMjU6c2VjcmV0MTI1
is a literal value (used to control early access to beta features).Click the checkmark to the right of the token to save it.
To return to the editor, click outside of the Edit HTTP Headers modal.
In the GraphQL Endpoint field, enter
https://cms.scopear.com/api/v3/graphql
.In the Method dropdown menu, select POST.
...
Code Block |
---|
{ "number_of_repos": 3 } |
Requesting support
For questions, bug reports, and discussions about Scope Apps, OAuth Apps, and API development, email api.support@scopear.com. This email group is moderated and maintained by Scope staff, but questions posted to the group are not guaranteed to receive a reply from Scope staff.
...
guaranteed response from Scope staff
support requests involving sensitive data or private concerns
feature requests
feedback about Scope products
Troubleshooting errors
Because GraphQL is introspective, the Explorer supports:
...
Note: Scope recommends checking for errors before using data in a production environment. In GraphQL, failure is not total: portions of GraphQL queries may succeed while others fail.
OAuth token
You must obtain a valid OAuth token before attempting to execute queries against, or explore the schema of, the Scope API.
...
Use your favorite HTTP client to sign in:
Code Block curl --request POST \ --url https://cms-3206.scopear.com/api/v2/users/sign_in.json \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data 'user[username]=YOUR_EMAIL' \ --data 'user[password]=YOUR_PASSWORD'
Parse the response as JSON and extract the value for key
auth_token
, e.g.:. For example the following response should yield the following token.Code Block { "id": 1, "email": "support@scopear.com", "name": "Support Account", "permalink": "supportscopearcom", "username": "support@scopear.com", "guest": false, "auth_token": "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJfaWQiOjEsImRldmljZV9pZCI6MX0sImV4cCI6MTYwODI0NDA3MSwianRpIjoiOGY3ODg1NTg2Y2Y4YTdiNjQ1MWIwZTcxMzFhODY1MDE2MmQwZWZhZjc3MTgwYTNhZmU5OTk2N2Y4OTZhNzlhOCIsImlhdCI6MTYwNTY1MjA3MX0.Z4hFOmLlUPolvW3u-2Ssn7LWX_c2y95a1fhID3QJuCg", ...
=>eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJfaWQiOjEsImRldmljZV9pZCI6MX0sImV4cCI6MTYwODI0NDA3MSwianRpIjoiOGY3ODg1NTg2Y2Y4YTdiNjQ1MWIwZTcxMzFhODY1MDE2MmQwZWZhZjc3MTgwYTNhZmU5OTk2N2Y4OTZhNzlhOCIsImlhdCI6MTYwNTY1MjA3MX0.Z4hFOmLlUPolvW3u-2Ssn7LWX_c2y95a1fhID3QJuCg
You may now use this token wherever an OAuth token is required.