Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a lighter project structure #10

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ad20c9d
adding postman collection json
rbills Oct 1, 2024
a73693f
adding an empty insomnia environment
rbills Oct 1, 2024
1014398
adding the insomnia collection json
rbills Oct 1, 2024
6974461
adjusting names for clarity
rbills Oct 1, 2024
d7cba16
adjusting names for clarity
rbills Oct 1, 2024
f5d4895
fixing name
rbills Oct 1, 2024
f7fadee
restructuring folders
rbills Oct 3, 2024
4b22470
adding raw graphql queries
rbills Oct 8, 2024
751edd8
restructuring folders
rbills Oct 10, 2024
aba1b25
adding change requests
rbills Oct 10, 2024
a8d3333
removing redundant file
rbills Oct 10, 2024
e697bca
adding compliance exception requests
rbills Oct 10, 2024
a0672e9
adding direct supplier incident requests
rbills Oct 10, 2024
a42e312
adding document review requests
rbills Oct 10, 2024
8b76c4c
renaming folder
rbills Oct 10, 2024
40e280c
renaming folder
rbills Oct 10, 2024
91601df
adding requests for external manufacturing
rbills Oct 10, 2024
3ebf57e
adding incident requests
rbills Oct 10, 2024
f66b13b
adding master data requests
rbills Oct 10, 2024
7911ea6
adding template management requests
rbills Oct 10, 2024
3e770fd
adding task requests
rbills Oct 10, 2024
4f582c2
renaming folder for consistency
rbills Oct 10, 2024
5079e83
Merge branch 'tracelink:main' into api_collections
rbills Oct 10, 2024
9a06aa7
adding a simple readme
rbills Oct 11, 2024
d2a540a
Merge branch 'main' into api_collections
rbills Oct 11, 2024
d9387d8
reorganizing
rbills Oct 11, 2024
fdf4a4e
renaming for consistency and restructuring
rbills Oct 11, 2024
3f154fe
reorganizing for simplicity
rbills Oct 11, 2024
36e36be
adding instructions
rbills Oct 11, 2024
e55a2aa
revising instructions
rbills Oct 11, 2024
ac82d60
revising instructions
rbills Oct 11, 2024
2858f68
revising for clarity
rbills Oct 11, 2024
772e0b8
adding a node sample
rbills Oct 11, 2024
1812b9e
adding blank program request files
rbills Oct 11, 2024
2bfa5a4
updating blank environment
rbills Nov 1, 2024
42fc7fe
updating collection with tested requests
rbills Nov 1, 2024
9dde662
updating for incident type and formatting
rbills Nov 8, 2024
b81a957
updating content and formats
rbills Nov 8, 2024
a6fe04a
realigning file for accuracy
rbills Nov 8, 2024
fe8edc8
adding new instructions
rbills Nov 8, 2024
8e31d6c
adding new instructions
rbills Nov 8, 2024
21c0dbf
restructuring
rbills Nov 8, 2024
12fe544
fixing typo
rbills Nov 8, 2024
1032649
fixing typo
rbills Nov 8, 2024
ff35d8f
fixing link
rbills Nov 8, 2024
2d02b0f
fixing link
rbills Nov 8, 2024
243b916
initial commit of new readme
rbills Nov 14, 2024
6aabe75
updating for new project structure
rbills Nov 14, 2024
a2b080a
fixing punctuation
rbills Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions EventNames.MD

This file was deleted.

4 changes: 2 additions & 2 deletions python/FormatRequests.MD → FormatRequests.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The request body header identifies how APT processes your request. All items be
| Name | Type | Description | Value |
| -------------------- | ------- | ---------------------------------------------------------------------- | ------------------------------------------ |
| `headerVersion` | integer | The version identifier for the request | `1` |
| `eventName` | string | The fully qualified name of the request event. | See [event name mapping](../EventNames.MD) |
| `eventName` | string | The fully qualified name of the request event. | See [event name mapping](../EventNames.md) |
| `ownerID` | string | The Owner company associated with the request. | See [authentication](../authentication.md) |
| `processNetworkId` | string | The network within the Owner company containing the process. | See [authentication](../authentication.md) |
| `appName` | string | The application that owns the event. | `"agile-process-teams"` |
Expand Down Expand Up @@ -55,4 +55,4 @@ An example of a complete payload body for adding a direct supplier incident:

# Next
Review [event name mapping](eventNames.json) for each event type.
Follow [the quickstart](Quickstart.MD) for an example using the APT-SCWM API.
Follow [the quickstart](Quickstart.md) for an example using the APT-SCWM API.
98 changes: 98 additions & 0 deletions GraphQL/GraphQL_Requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Incorporating GraphQL into your automation solutions #
The GraphQL code samples provided contain the payloads necessary to make requests to the Opus platform.
Use your preferred programming language to construct the HTTP request for the desired action. Your ```Headers``` section contains the relevant authorization data for your environment.
Incorporate the payload into the body of your request. The request text must be converted to a JSON string for inclusion.
For example:
### Original Query ###
Query:
```
mutation AddIncident($action: String!, $payload: JSON!) {
genericActionCall(action: $action, payload: $payload) {
result
__typename
}
}
```
Variables
```
{
"action": "Addincident",
"payload":{
"aptBusinessObjectSummary": "Printing error",
"aptBusinessObjectDescription":"Label printing offset",
"businessPriority":"LOW",
"incidentType":"LABEL_COMPLIANCE_ERROR",
"resolutionDueDate":"1736613281000" // 11 Jan 2025
}
}
```
Add your converted strings to a payload. Create a single object containing query and variables objects.
### Python ###
```
import requests
import json

url = "https://valvir-opus.tracelink.com/api/graphql"

payload = "{\"query\":\"mutation AddIncident($action: String!, $payload: JSON!)\\n{\\n genericActionCall(action: $action, payload: $payload)\\n {\\n result\\n __typename\\n } \\n}\",\"variables\":{\"action\": \"Addincident\",\"payload\": {\"aptBusinessObjectSummary\":\"Printing error\",\"aptBusinessObjectDescription\": \"Label printing offset on package\",\"businessPriority\": \"LOW\",\"incidentType\":\"LABEL_COMPLIANCE_ERROR\",\"resolutionDueDate\": \"1736613281000\"}}}"
headers = {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
'Dataspace': 'default',
'companyId': 'YOUR_COMPANY_ID',
'processNetworkId': 'YOUR_NETWORK_ID'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```
### Node.js ###
```
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://valvir-opus.tracelink.com/api/graphql',
'headers': {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
'Dataspace': 'default',
'companyId': 'YOUR_COMPANY_ID',
'processNetworkId': 'YOUR_NETWORK_ID'
},
body: JSON.stringify({
query: `mutation AddIncident($action: String!, $payload: JSON!)
{
genericActionCall(action: $action, payload: $payload)
{
result
__typename
}
}`,
variables:
{"action": "Addincident",
"payload":
{"aptBusinessObjectSummary":"Printing error",
"aptBusinessObjectDescription": "Label printing offset on package",
"businessPriority": "LOW",
"incidentType":"LABEL_COMPLIANCE_ERROR",
"resolutionDueDate": "1736613281000"}}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
```
In this example, Opus automatically assigns Business Object and Id values. The response will contain both values and be similar to the example below:
```
{
"data": {
"genericActionCall": {
"result": "{\"aptBusinessObjectId\":\"USPT-0000\",\"id\":\"aa0a00aa-0a00-0aaa-0a00-000000a000000\"}",
"__typename": "ReadResult"
}
}
}
```
The ```id``` item allows subsequent calls to update, comment, copy, close, or reopen this new record.
25 changes: 0 additions & 25 deletions GraphQL/ceIncident/addCEIncident.py

This file was deleted.

25 changes: 0 additions & 25 deletions GraphQL/ceIncident/addCEIncidentComment.py

This file was deleted.

25 changes: 0 additions & 25 deletions GraphQL/ceIncident/editCEIncident.py

This file was deleted.

23 changes: 0 additions & 23 deletions GraphQL/ceIncident/getCEIncidentHistory.py

This file was deleted.

23 changes: 0 additions & 23 deletions GraphQL/ceIncident/listCEIncidentComments.py

This file was deleted.

Loading