Skip to content

Commit

Permalink
Merge pull request #18955 from brnhensley/patch-4
Browse files Browse the repository at this point in the history
chore: add syntax highting and formatting to code
  • Loading branch information
jeff-colucci authored Oct 14, 2024
2 parents 8c6ff3e + 69c3b7d commit 454df8c
Showing 1 changed file with 40 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ To create multiple keys (user key or license key) in a single mutation, for mult

Example of creating a key:

```
```graphql
mutation {
apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType:
BROWSER, name: "Browser Key", notes: "A note."}}) {
apiAccessCreateKeys(
keys: {
ingest: {
accountId: YOUR_ACCOUNT_ID
ingestType: BROWSER
name: "Browser Key"
notes: "A note."
}
}
) {
createdKeys {
id
key
Expand Down Expand Up @@ -91,9 +99,16 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star
>
To create a [user key](/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key), you'd change the above query slightly, in the `keys` section:

```
```graphql
mutation {
apiAccessCreateKeys(keys: {user: {accountId: YOUR_ACCOUNT_ID, userId: YOUR_USER_ID}}) {
apiAccessCreateKeys(
keys: {
user: {
accountId: YOUR_ACCOUNT_ID,
userId: YOUR_USER_ID
}
}
) {
createdKeys {
id
key
Expand Down Expand Up @@ -123,10 +138,17 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star

The update mutation takes the key ID, not the key string, to identify keys.

```
```graphql
mutation {
apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: "Updated name", notes:
"A new note!"}}) {
apiAccessUpdateKeys(
keys: {
ingest: {
keyId: KEY_ID,
name: "Updated name",
notes: "A new note!"
}
}
) {
updatedKeys {
id
key
Expand All @@ -147,9 +169,9 @@ Results will vary depending on your data. Use the [GraphiQL explorer](https://ap

The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API.

```
```graphql
mutation {
apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) {
apiAccessDeleteKeys(keys: { ingestKeyIds: INGEST_KEY_ID }) {
deletedKeys {
id
}
Expand All @@ -168,7 +190,7 @@ You can access ingest and user keys by querying a single key or all keys, scoped

Single key example query:

```
```graphql
query {
actor {
apiAccess {
Expand All @@ -187,11 +209,16 @@ query {

Key search example query:

```
```graphql
query {
actor {
apiAccess {
keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) {
keySearch(query: {
types: INGEST,
scope: {
ingestTypes: BROWSER
}
}) {
keys {
name
key
Expand Down

0 comments on commit 454df8c

Please sign in to comment.