addClient
This method creates a new Oauth client for the user
/users/{user_id}/clients
Usage and SDK Samples
curl -X post "https://CHANGEME.api.processmaker.io/api/v1/users/{user_id}/clients"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .ProcessmakerApi;
import java.io.File;
import java.util.*;
public class ProcessmakerApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: PasswordGrant
OAuth PasswordGrant = (OAuth) defaultClient.getAuthentication("PasswordGrant");
PasswordGrant.setAccessToken("YOUR ACCESS TOKEN");
ProcessmakerApi apiInstance = new ProcessmakerApi();
String userId = userId_example; // String | ID of the user related to the Oauth client
ClientCreateItem clientCreateItem = ; // ClientCreateItem | JSON API with the Oauth Client object to add
try {
ClientItem result = apiInstance.addClient(userId, clientCreateItem);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProcessmakerApi#addClient");
e.printStackTrace();
}
}
}
import .ProcessmakerApi;
public class ProcessmakerApiExample {
public static void main(String[] args) {
ProcessmakerApi apiInstance = new ProcessmakerApi();
String userId = userId_example; // String | ID of the user related to the Oauth client
ClientCreateItem clientCreateItem = ; // ClientCreateItem | JSON API with the Oauth Client object to add
try {
ClientItem result = apiInstance.addClient(userId, clientCreateItem);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProcessmakerApi#addClient");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: PasswordGrant)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
String *userId = userId_example; // ID of the user related to the Oauth client
ClientCreateItem *clientCreateItem = ; // JSON API with the Oauth Client object to add
ProcessmakerApi *apiInstance = [[ProcessmakerApi alloc] init];
[apiInstance addClientWith:userId
clientCreateItem:clientCreateItem
completionHandler: ^(ClientItem output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var = require('');
var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: PasswordGrant
var PasswordGrant = defaultClient.authentications['PasswordGrant'];
PasswordGrant.accessToken = "YOUR ACCESS TOKEN"
var api = new .ProcessmakerApi()
var userId = userId_example; // {String} ID of the user related to the Oauth client
var clientCreateItem = ; // {ClientCreateItem} JSON API with the Oauth Client object to add
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addClient(userId, clientCreateItem, callback);
using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;
namespace Example
{
public class addClientExample
{
public void main()
{
// Configure OAuth2 access token for authorization: PasswordGrant
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProcessmakerApi();
var userId = userId_example; // String | ID of the user related to the Oauth client
var clientCreateItem = new ClientCreateItem(); // ClientCreateItem | JSON API with the Oauth Client object to add
try
{
ClientItem result = apiInstance.addClient(userId, clientCreateItem);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ProcessmakerApi.addClient: " + e.Message );
}
}
}
}
setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new io.swagger.client\Api\ProcessmakerApi();
$userId = userId_example; // String | ID of the user related to the Oauth client
$clientCreateItem = ; // ClientCreateItem | JSON API with the Oauth Client object to add
try {
$result = $api_instance->addClient($userId, $clientCreateItem);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProcessmakerApi->addClient: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Description |
---|---|
userId* |
Name | Description |
---|---|
clientCreateItem * |