Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

GraphQL IDEs

...

...

Note that users other than super/company admins can now use GraphQL to run queries.

...

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

Note: The Scope GraphQL Explorer has been temporarily disabled, but you can still explore the graph using a local GraphiQL client, or any other similar client (see below).

Using GraphiQL

To use the GraphiQL app, download and install it from https://www.electronjs.org/apps/graphiql.

Configuring GraphiQL

  1. Getting an OAuth token can be done thru CMS

    1. Log in to CMS as your authorized user and open the Developers Console (F12 usually does this)

    2. Open the Application tab and copy the Auth token from Cookies

      Image Modified

  2. Ensure the authenticated user has the Access Control Rights required by the query to be executed (See Authorization Errors & Reporting Admins).

  3. Launch GraphiQL.

  4. In the upper-right corner of GraphiQL, click Edit HTTP Headers.

  5. If you don’t already have GraphiQL setup with Headers, do the following;

    1. In the upper-right corner of the modal dialog, click + Add Header.

    2. In the Key field, enter Authorization. In the Value field, enter Token token=<token>, where <token> is your generated OAuth token.

      Image Modified
    3. Click Save to save the token.

    4. If you hold an analyst license, you can obtain your token thru your user profile on CMS

      1. Login and navigate to Edit Profile

      2. The API Key on the bottom right is your token

    5. In the upper-right corner of the modal dialog, click + Add Header.

    6. In the Key field, enter PrivateAccessCode. In the Value field, enter Token token=YWRtaW4xMjU6c2VjcmV0MTI1, where YWRtaW4xMjU6c2VjcmV0MTI1 is a literal value (used to enable early access to the Scope GraphQL API).

      Image Modified
    7. Click Save to save the token.

    8. To return to the editor, click outside of the Edit HTTP Headers modal.

  6. In the GraphQL Endpoint field, enter the following (include company permalink if necessary)

...

    1. Image Added
  1. In the Method dropdown menu, select POST.

You can test your access by querying yourself:

...

It's possible you might run into an unexpected error that is not related to the schema. If this happens, the message will include a reference code you can use when reporting the issue to support:

Code Block
{
  "data": null,
  "errors": [
    {
      "message": "Something went wrong while executing your query. This is most likely a Scope bug. Please include \"7571:3FF6:552G94B:69F45B7:5913BBEQ\" when reporting this issue."
    }
  ]
}

...

If you need additional help, see Requesting support.

OAuth token

You must obtain a valid OAuth token before attempting to execute queries against, or explore the schema of, the Scope API.

...