Frequently Asked Questions
- Get a link to this question
GraphQL is parsed by our .NET servers (C#) running on the cloud and using a technology called Hot Chocolate to process the operations (queries and mutations).
Behind the scenes Design and Manufacturing operations are fulfilled by RESTful services, and everything is exposed by the GraphQL API. Supply queries are powered by Octopart services.
- Get a link to this question
If you access the built-in IDE from the sidebar menu, it will by default attempt to authorize using the credentials of the first application in your organization.
If you want to use a different application, navigate to the Applications page, click on Show Details of the desired application, and go to IDE at the bottom of the page.
- Get a link to this question
Nexar uses the Identity Server model which implements OAuth2 standards. Tools are provided to generate the access token from your Nexar application.
Optionally for those customers who need design data also from their Altium Live login credentials. For those only using the Supply domain, Nexar credentials suffice.
- Get a link to this question
Nexar access tokens are valid for 24 hours.
Supply only API users can use the
client_credentials
flow with a Nexar app that is only asking for a supply domain queries (the supply.domain grant). There are public examples in .NET tokens from Nexar here.Once you have a token client applications should cache the token for 24 hours rather than generate a new token for each query.
If you are planning on accessing Altium Designer or Altium365 data, it will require a user authorization, changing to an
authorization_code
plus optionalrefresh_token
flow.If there is any chance you might wish to use Supply API in the future for your application, you should for now sign up for both Design and Supply domains.
If you accidentally try to use an expired token you will receive an error response with a specific message
The access token has expired
. - Get a link to this question
Yes there is. In order to protect our identity server, the frequency with which new access tokens can be requested is restricted.
Please ensure you do not request tokens more frequently than any of our limits:2 tokens every second
200 tokens every 15 minutes
3,000 tokens every 12 hours
40,000 every week
Access tokens are valid for 24 hours and we ask that applications cache and their tokens for this period.
- Get a link to this question
You can use Banana Cake Pop IDE (BCP) in order to explore available GraphQL operations (queries, mutations, subscriptions), compose and invoke them, and see the results.
Click the "Documents" button in the left command bar. In the opened "Documents" panel click the "New document" button and enter the document name. Compose an operation (e.g. a query) in the "Operations" panel and click "Run". See the operation results in the "Response" panel.Ensure you have added your Nexar access token using this (key: value) in the HTTP header section:
Authorization: Bearer <your Nexar token>
In addition, you may click the "Operations" button for extra commands:
"Schema Reference", the list of all GraphQL operations and their parameters.
"Schema Definition", the whole Nexar GraphQL schema in schema definition language (SDL).
- Get a link to this question
Yes, there is a Nexar Excel add-in available which you can install and use to connect to the supply API. The add-in itself is available here and a video guide for getting going is below...
- Get a link to this question
Yes! For stale data, use “Force Rerun All” on the new Nexar Supply tab on the ribbon. Each login lasts for 24 hours before another login is required using the "Refresh Login" button. You can also trigger one of these by changing the
ClientID
string and then putting it back to the original value.Please ensure there is only one call to
=NEXAR_SUPPLY_LOGIN()
in your entire workbook. - Get a link to this question
The BCP IDE supports OAuth 2 and in Nexar the
Authorization Code
,Client Credentials
and (when enabled)Resource Owner Password
flows are configured for accessing the API.
Begin with the “Connection Settings” dialog box (click on the gear icon at the upper right of the page) and under the "Authorization" tab select “OAuth2” from the drop down:The configuration details will be slightly different for applications that only use the supply queries (Nexar queries that are prefixed with "sup") and applications using the design queries to access A365 design data (prefixed with "des").
Supply Applications
Supply applications use a
Client Credentials
flow with the following settings:Type: OAuth 2
Grant Type: Client Credentials
Access Token URL: https://identity.nexar.com/connect/token
Client ID: << from the application details page >>
Client Secret: << from the application details page >>
Scope: supply.domain
Once you have entered all the details, click the “Fetch Token” button to get the token and click the “Apply” button to close the settings dialog.
Design Applications
Design applications use an
Authorization Code
flow. Configure the properties as below:Authorization URL: https://identity.nexar.com/connect/authorize
Access Token URL: https://identity.nexar.com/connect/token
Client ID: << from the application details page >>
Client Secret: << from the application details page >>
Redirect URL: https://api.nexar.com/graphql/
Scope: openid profile email user.access design.domain offline_access
Remember the "Show Details" button for the application will get you access to the following details and allow you to configure the callback URL - don’t forget to do that!
Once you have entered all the details, click the “Fetch Token” button to get the token and click the “Apply” button to close the settings dialog.
- Get a link to this question
We sure do! Here's an example which makes a HTTP POST request to generate an access token for supply queries
curl --location --request POST 'https://identity.nexar.com/connect/token' \ --header 'User-Agent: <your Nexar Client>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-raw 'grant_type=client_credentials&client_id=<your Client Id>&client_secret=<your Client Secret>&scope=supply.domain'
For performance reasons, and to reduce the pressure on our identity service, please cache the access token (it is valid by default for up to 24 hours) rather than generate a new token for every query.
Be sure to replace the <your client> fields with your client information.
- Get a link to this question
Yes! You can generate a token suitable for supply queries by making a POST request to the Nexar identity server. There are a number of examples in our public GitHub samples (and a cURL example) but here is a snippet of jQuery code you can utilise on front-end applications.
var settings = { "url": "https://identity.nexar.com/connect/token", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "data": { "client_id": "<your_client_id>", "client_secret": "<your_client_secret>", "grant_type": "client_credentials" } }; $.ajax(settings).done(function (response) { console.log(response); });
The response should be similar to the following:
The response should be similar to this: { "access_token": "<your_access_token>", "expires_in": 86400, "token_type": "Bearer", "scope": "supply.domain" }
For performance reasons, and to reduce the pressure on our identity service, please cache the access token (it is valid by default for up to 24 hours) rather than generate a new token for every query.
Be sure to replace the <your_client_id> and <your_client_secret> fields with your Nexar application client information.
Couldn't find an answer to your question?
Get in touch at support@nexar.com