Skip to content

Commit

Permalink
Merged main into main-pt
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-docs-eng-opensource-bot authored Oct 14, 2024
2 parents 4f7f246 + b6be5b2 commit dff1ef0
Show file tree
Hide file tree
Showing 29 changed files with 1,608 additions and 1,499 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
Loading

0 comments on commit dff1ef0

Please sign in to comment.