apiKeysRotate
Rotate the calling API key.
/v1/orgs/{orgid}/api_keys/rotate
Usage and Examples
curl -X POST \
-H "Authorization: Bearer [[accessToken]]" \
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"https://api.pulse.neat.no/v1/orgs/{orgid}/api_keys/rotate" \
-d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ApiKeysApi;
import java.io.File;
import java.util.*;
public class ApiKeysApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure Bearer access token for authorization: bearerToken
HttpBearerAuth bearerToken = (HttpBearerAuth) defaultClient.getAuthentication("bearerToken");
bearerToken.setBearerToken("BEARER TOKEN");
// Create an instance of the API class
ApiKeysApi apiInstance = new ApiKeysApi();
String orgid = orgid_example; // String |
V1RotateApiKeyRequest v1RotateApiKeyRequest = ; // V1RotateApiKeyRequest |
try {
v1RotateApiKeyResponse result = apiInstance.apiKeysRotate(orgid, v1RotateApiKeyRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApiKeysApi#apiKeysRotate");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.ApiKeysApi;
public class ApiKeysApiExample {
public static void main(String[] args) {
ApiKeysApi apiInstance = new ApiKeysApi();
String orgid = orgid_example; // String |
V1RotateApiKeyRequest v1RotateApiKeyRequest = ; // V1RotateApiKeyRequest |
try {
v1RotateApiKeyResponse result = apiInstance.apiKeysRotate(orgid, v1RotateApiKeyRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApiKeysApi#apiKeysRotate");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure Bearer access token for authorization: bearerToken
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
ApiKeysApi *apiInstance = [[ApiKeysApi alloc] init];
String *orgid = orgid_example; // (default to null)
V1RotateApiKeyRequest *v1RotateApiKeyRequest = ; //
// Rotate the calling API key.
[apiInstance apiKeysRotateWith:orgid
v1RotateApiKeyRequest:v1RotateApiKeyRequest
completionHandler: ^(v1RotateApiKeyResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var NeatPulseApi = require('neat_pulse_api');
var defaultClient = NeatPulseApi.ApiClient.instance;
// Configure Bearer access token for authorization: bearerToken
var bearerToken = defaultClient.authentications['bearerToken'];
bearerToken.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new NeatPulseApi.ApiKeysApi()
var orgid = orgid_example; // {String}
var v1RotateApiKeyRequest = ; // {V1RotateApiKeyRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.apiKeysRotate(orgid, v1RotateApiKeyRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class apiKeysRotateExample
{
public void main()
{
// Configure Bearer access token for authorization: bearerToken
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new ApiKeysApi();
var orgid = orgid_example; // String | (default to null)
var v1RotateApiKeyRequest = new V1RotateApiKeyRequest(); // V1RotateApiKeyRequest |
try {
// Rotate the calling API key.
v1RotateApiKeyResponse result = apiInstance.apiKeysRotate(orgid, v1RotateApiKeyRequest);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling ApiKeysApi.apiKeysRotate: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer access token for authorization: bearerToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ApiKeysApi();
$orgid = orgid_example; // String |
$v1RotateApiKeyRequest = ; // V1RotateApiKeyRequest |
try {
$result = $api_instance->apiKeysRotate($orgid, $v1RotateApiKeyRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ApiKeysApi->apiKeysRotate: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ApiKeysApi;
# Configure Bearer access token for authorization: bearerToken
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ApiKeysApi->new();
my $orgid = orgid_example; # String |
my $v1RotateApiKeyRequest = WWW::OPenAPIClient::Object::V1RotateApiKeyRequest->new(); # V1RotateApiKeyRequest |
eval {
my $result = $api_instance->apiKeysRotate(orgid => $orgid, v1RotateApiKeyRequest => $v1RotateApiKeyRequest);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ApiKeysApi->apiKeysRotate: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure Bearer access token for authorization: bearerToken
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.ApiKeysApi()
orgid = orgid_example # String | (default to null)
v1RotateApiKeyRequest = # V1RotateApiKeyRequest |
try:
# Rotate the calling API key.
api_response = api_instance.api_keys_rotate(orgid, v1RotateApiKeyRequest)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiKeysApi->apiKeysRotate: %s\n" % e)
extern crate ApiKeysApi;
pub fn main() {
let orgid = orgid_example; // String
let v1RotateApiKeyRequest = ; // V1RotateApiKeyRequest
let mut context = ApiKeysApi::Context::default();
let result = client.apiKeysRotate(orgid, v1RotateApiKeyRequest, &context).wait();
println!("{:?}", result);
}
| Scopes |
|---|
Parameters
Path parameters
| Name | Description |
|---|---|
| orgid * |
String
Required
|
Body parameters
| Name | Description |
|---|---|
| v1RotateApiKeyRequest * |