Developer Docs
API Quick Start Tutorials

GraphQL Tutorial

Apollo Studio GraphQL Setup

The URL for the Xecta GQL endpoint is: https://api.onxecta.com/api/gql

Navigate to Apollo Studio

To navigate to Apollo Studio, open your web browser and navigate to https://api.onxecta.com/api/gql

Document image


Generate Bearer Token and Configure Headers

JWT Token

You can use a user-based JWT from the ProdX application or a bearer token from MTLS. For MTLS, please refer to the Postman Tutorial for instructions on obtaining a token. To obtain a user-based, navigate to ProdX at [customer].app.onxecta.com, click on your initials in the top right corner of the screen to open the menu, and click directly on your name to copy a token to the clipboard.

Note: JWT tokens expire after a period of time. If queries stop functioning, generate a new token and update your query or shared header.

Document image


Headers

Add a Header with the key name "Authorization" and the value as "Bearer {INSERT JWT TOKEN HERE}". Make sure you leave a space between bearer and the token itself.

Adding a header as shown below will only apply to the current query. If you click the link at the bottom right of the center column titled "Set Shared Headers", you can set a global header which will apply to all query tabs you have open.

Note: JWT tokens expire after a period of time. If queries stop functioning, generate a new token and update your query or shared header.

Setting Auth Header
Setting Auth Header



Query Wells

For many of the GraphQL requests, you will need to run a query to get the XID's (Xecta's unique identifiers for your data entries) for the wells which you want to interact with. You can enter a query manually in the center "operation" section of apollo or you can use the navigation tree on the right side of the screen to interactively build a query. Hovering over items in the tree will launch a popup with additional documentation about the entity.

GraphQL


Paste this query into Apollo Studio and click the "GetWellInfo" execution button

Query pasted into Apollo Studio
Query pasted into Apollo Studio


This will return all wells in the database in the response section on the right.



Query Well Performance Analysis Results

One of the most common queries is for cleansed daily data supplemented with all daily output values from ProdX (like bottomhole pressure, productivity index, etc.). The sample below shows you how to query for this information.

GraphQL


Paste the query above into the "Operation" panel of Apollo Studio.

Document image


For this query, you will have to add "Variables" for the start date, end date, and a list of XIDs (Xecta unique identifier for the well) that you want to query.

At the bottom of the Apollo Studio, click the "Variables" tab, and paste in the following code. Make sure the startDate and endDate are ISO8601 complaint date strings.

Variables


Press the blue "WellPerformanceAnalysisResults" Execution button in the top right of the "Operation" section of apollo studio. You will see your results for your listed wells on the right

Document image


You can change from a JSON to Tabular view by switching between the icons below

Switching results views
Switching results views