Connecting a tool with an access token
Make an access token under Connected apps and use it from a script, a spreadsheet or a reporting tool to read your characteristics, charts and flagged points.
What a token can do #
An access token lets your own scripts and reporting tools read the same figures your SPC Prism screens show: the list of characteristics, a characteristic's control chart, the points flagged by a rule, and capability. A token only ever reads. Nothing it does can change data in SPC Prism or in Plex.
Every answer says how fresh the data is: data_through is the time of the newest record in your copy of Plex. The copy is not live, so a report built on it should show that time too.
Making a token #
- Open Your account and choose Connected apps.
- Choose Make an access token.
- Give it a name you will recognise later, such as Weekly quality report.
- Untick anything the tool does not need to read. A report that lists characteristics and capability needs only streams:read.
- Choose the sites: every site you can see, or only the ones you tick.
- Choose how long it lasts: 30, 90 or 365 days.
- Choose Make token, then copy it straight away.
The token is shown once. SPC Prism keeps only a fingerprint of it, so it cannot be shown again. Keep it somewhere safe, such as a password manager. If it is lost, remove it and make a new one.
Using it #
Send the token in the Authorization header of every request:
curl -H "Authorization: Bearer spcp_YOUR_TOKEN" https://spcprism.com/api/v1/sites
Most reporting tools have a place for a request header, often called HTTP request header parameters or custom headers. A token put in the address is refused, because addresses end up in logs and browser history.
The API reference lists every address, what it returns, its parameters and an example you can copy.
What a token sees #
A token acts as you. It sees the sites you can see today, narrowed to the sites you chose for it, and never more. If an owner or admin changes your sites, your tokens change with them on their next request. If you leave the organisation, your tokens stop working at once.
A characteristic at a site the token cannot see answers not found, exactly as if it did not exist.
Limits #
Each token may make 60 requests a minute and 10,000 a day. Past a limit, the answer is slow down (status 429) with a Retry-After header that says how many seconds to wait. A well-behaved script waits that long and carries on.
Removing a token #
Open Connected apps and choose Remove beside the token. Anything using it stops working straight away. The list also shows when each token was last used, which helps you spot one nobody needs any more.
For owners and admins #
Owners and admins see every token and AI connection in the organisation on Connected apps, with who made it and when it was last used, and can remove any of them. The Organisation setting there switches tokens and AI connections off for everyone at once; switching it back on lets the ones that were not removed work again.
Owners and admins need two-step sign-in turned on before their tokens can be used.
Dashboards #
With dashboards:read, a token lists the dashboards you may open (published ones), reads one dashboard's tiles and versions, and reads up to four tiles' data a request. Each tile still needs its own scope: a production tile answers not available to a token without production:read. Tokens cannot change dashboards.
Shipping #
With shipping:read, a token reads shipping on time and in full: customer releases due, shipped and late, by customer and part, including your customers' codes and names. It is separate from production:read so that a tool can see production without seeing who your customers are.