---
title: ExternalContactsApi
---
## PureCloud::ExternalContactsApi
All URIs are relative to *https://api.mypurecloud.com*
Method | HTTP request | Description
------------- | ------------- | -------------
|[**delete_contacts_contact_id**](ExternalContactsApi.html#delete_contacts_contact_id) | **DELETE** /api/v2/externalcontacts/contacts/{contactId} | Delete a contact|
|[**delete_contacts_contact_id_notes_note_id**](ExternalContactsApi.html#delete_contacts_contact_id_notes_note_id) | **DELETE** /api/v2/externalcontacts/contacts/{contactId}/notes/{noteId} | Delete a note for a contact|
|[**delete_organizations_externalorganization_id**](ExternalContactsApi.html#delete_organizations_externalorganization_id) | **DELETE** /api/v2/externalcontacts/organizations/{externalOrganizationId} | Delete an External Organization|
|[**delete_organizations_externalorganization_id_notes_note_id**](ExternalContactsApi.html#delete_organizations_externalorganization_id_notes_note_id) | **DELETE** /api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId} | Delete a note|
|[**delete_relationships_relationship_id**](ExternalContactsApi.html#delete_relationships_relationship_id) | **DELETE** /api/v2/externalcontacts/relationships/{relationshipId} | Delete a relationship|
|[**get_contacts**](ExternalContactsApi.html#get_contacts) | **GET** /api/v2/externalcontacts/contacts | Search for External Contacts|
|[**get_contacts_contact_id**](ExternalContactsApi.html#get_contacts_contact_id) | **GET** /api/v2/externalcontacts/contacts/{contactId} | Fetch a ExternalContact|
|[**get_contacts_contact_id_notes**](ExternalContactsApi.html#get_contacts_contact_id_notes) | **GET** /api/v2/externalcontacts/contacts/{contactId}/notes | List Notes for an ExternalContact|
|[**get_contacts_contact_id_notes_note_id**](ExternalContactsApi.html#get_contacts_contact_id_notes_note_id) | **GET** /api/v2/externalcontacts/contacts/{contactId}/notes/{noteId} | Fetch a note for a contact|
|[**get_organizations**](ExternalContactsApi.html#get_organizations) | **GET** /api/v2/externalcontacts/organizations | Search for External Organizations|
|[**get_organizations_externalorganization_id**](ExternalContactsApi.html#get_organizations_externalorganization_id) | **GET** /api/v2/externalcontacts/organizations/{externalOrganizationId} | Fetch an External Organization|
|[**get_organizations_externalorganization_id_contacts**](ExternalContactsApi.html#get_organizations_externalorganization_id_contacts) | **GET** /api/v2/externalcontacts/organizations/{externalOrganizationId}/contacts | Search for External Contacts|
|[**get_organizations_externalorganization_id_notes**](ExternalContactsApi.html#get_organizations_externalorganization_id_notes) | **GET** /api/v2/externalcontacts/organizations/{externalOrganizationId}/notes | List Notes for an External Organization|
|[**get_organizations_externalorganization_id_notes_note_id**](ExternalContactsApi.html#get_organizations_externalorganization_id_notes_note_id) | **GET** /api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId} | Fetch a note|
|[**get_organizations_externalorganization_id_relationships**](ExternalContactsApi.html#get_organizations_externalorganization_id_relationships) | **GET** /api/v2/externalcontacts/organizations/{externalOrganizationId}/relationships | Fetch an External Organization|
|[**get_relationships_relationship_id**](ExternalContactsApi.html#get_relationships_relationship_id) | **GET** /api/v2/externalcontacts/relationships/{relationshipId} | Fetch a relationship|
|[**post_contacts**](ExternalContactsApi.html#post_contacts) | **POST** /api/v2/externalcontacts/contacts | Create an ExternalContact|
|[**post_contacts_contact_id_notes**](ExternalContactsApi.html#post_contacts_contact_id_notes) | **POST** /api/v2/externalcontacts/contacts/{contactId}/notes | Create a Note for an ExternalContact|
|[**post_organizations**](ExternalContactsApi.html#post_organizations) | **POST** /api/v2/externalcontacts/organizations | Create an External Organization|
|[**post_organizations_externalorganization_id_notes**](ExternalContactsApi.html#post_organizations_externalorganization_id_notes) | **POST** /api/v2/externalcontacts/organizations/{externalOrganizationId}/notes | Create a Note for an External Organization|
|[**post_relationships**](ExternalContactsApi.html#post_relationships) | **POST** /api/v2/externalcontacts/relationships | Create a relationship|
|[**put_contacts_contact_id**](ExternalContactsApi.html#put_contacts_contact_id) | **PUT** /api/v2/externalcontacts/contacts/{contactId} | Update a externalContact|
|[**put_contacts_contact_id_notes_note_id**](ExternalContactsApi.html#put_contacts_contact_id_notes_note_id) | **PUT** /api/v2/externalcontacts/contacts/{contactId}/notes/{noteId} | Update a note for a contact|
|[**put_organizations_externalorganization_id**](ExternalContactsApi.html#put_organizations_externalorganization_id) | **PUT** /api/v2/externalcontacts/organizations/{externalOrganizationId} | Update an External Organization|
|[**put_organizations_externalorganization_id_notes_note_id**](ExternalContactsApi.html#put_organizations_externalorganization_id_notes_note_id) | **PUT** /api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId} | Update a note|
|[**put_relationships_relationship_id**](ExternalContactsApi.html#put_relationships_relationship_id) | **PUT** /api/v2/externalcontacts/relationships/{relationshipId} | Update a relationship|
{: class="table table-striped"}
## - delete_contacts_contact_id(contact_id)
Delete a contact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact ID
begin
#Delete a contact
api_instance.delete_contacts_contact_id(contact_id)
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->delete_contacts_contact_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact ID |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## - delete_contacts_contact_id_notes_note_id(contact_id, note_id)
Delete a note for a contact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact Id
note_id = "note_id_example" # String | Note Id
begin
#Delete a note for a contact
api_instance.delete_contacts_contact_id_notes_note_id(contact_id, note_id)
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->delete_contacts_contact_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact Id |
**note_id** | **String**| Note Id |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## - delete_organizations_externalorganization_id(external_organization_id)
Delete an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization ID
begin
#Delete an External Organization
api_instance.delete_organizations_externalorganization_id(external_organization_id)
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->delete_organizations_externalorganization_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization ID |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## - delete_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id)
Delete a note
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization Id
note_id = "note_id_example" # String | Note Id
begin
#Delete a note
api_instance.delete_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id)
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->delete_organizations_externalorganization_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization Id |
**note_id** | **String**| Note Id |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## - delete_relationships_relationship_id(relationship_id)
Delete a relationship
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
relationship_id = "relationship_id_example" # String | Relationship Id
begin
#Delete a relationship
api_instance.delete_relationships_relationship_id(relationship_id)
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->delete_relationships_relationship_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**relationship_id** | **String**| Relationship Id |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ContactListing**](ContactListing.html) get_contacts(opts)
Search for External Contacts
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
q: "q_example", # String | User supplied search keywords (no special syntax is currently supported)
sort_order: "sort_order_example", # String | Sort order
expand: ["expand_example"] # Array | which fields, if any, to expand
}
begin
#Search for External Contacts
result = api_instance.get_contacts(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_contacts: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**q** | **String**| User supplied search keywords (no special syntax is currently supported) | [optional]
**sort_order** | **String**| Sort order | [optional]
**expand** | [**Array<String>**](String.html)| which fields, if any, to expand | [optional]
{: class="table table-striped"}
### Return type
[**ContactListing**](ContactListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalContact**](ExternalContact.html) get_contacts_contact_id(contact_id, opts)
Fetch a ExternalContact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact ID
opts = {
expand: ["expand_example"] # Array | which fields, if any, to expand
}
begin
#Fetch a ExternalContact
result = api_instance.get_contacts_contact_id(contact_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_contacts_contact_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact ID |
**expand** | [**Array<String>**](String.html)| which fields, if any, to expand | [optional]
{: class="table table-striped"}
### Return type
[**ExternalContact**](ExternalContact.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**NoteListing**](NoteListing.html) get_contacts_contact_id_notes(contact_id, opts)
List Notes for an ExternalContact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact Id
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
sort_order: "sort_order_example" # String | Sort order
}
begin
#List Notes for an ExternalContact
result = api_instance.get_contacts_contact_id_notes(contact_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_contacts_contact_id_notes: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact Id |
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**sort_order** | **String**| Sort order | [optional]
{: class="table table-striped"}
### Return type
[**NoteListing**](NoteListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) get_contacts_contact_id_notes_note_id(contact_id, note_id)
Fetch a note for a contact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact Id
note_id = "note_id_example" # String | Note Id
begin
#Fetch a note for a contact
result = api_instance.get_contacts_contact_id_notes_note_id(contact_id, note_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_contacts_contact_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact Id |
**note_id** | **String**| Note Id |
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalOrganizationListing**](ExternalOrganizationListing.html) get_organizations(opts)
Search for External Organizations
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
q: "q_example", # String | Search query
sort_order: "sort_order_example" # String | Sort order
}
begin
#Search for External Organizations
result = api_instance.get_organizations(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**q** | **String**| Search query | [optional]
**sort_order** | **String**| Sort order | [optional]
{: class="table table-striped"}
### Return type
[**ExternalOrganizationListing**](ExternalOrganizationListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalOrganization**](ExternalOrganization.html) get_organizations_externalorganization_id(external_organization_id)
Fetch an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization ID
begin
#Fetch an External Organization
result = api_instance.get_organizations_externalorganization_id(external_organization_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations_externalorganization_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization ID |
{: class="table table-striped"}
### Return type
[**ExternalOrganization**](ExternalOrganization.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ContactListing**](ContactListing.html) get_organizations_externalorganization_id_contacts(external_organization_id, opts)
Search for External Contacts
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization ID
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
q: "q_example", # String | User supplied search keywords (no special syntax is currently supported)
sort_order: "sort_order_example", # String | Sort order
expand: ["expand_example"] # Array | which fields, if any, to expand
}
begin
#Search for External Contacts
result = api_instance.get_organizations_externalorganization_id_contacts(external_organization_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations_externalorganization_id_contacts: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization ID |
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**q** | **String**| User supplied search keywords (no special syntax is currently supported) | [optional]
**sort_order** | **String**| Sort order | [optional]
**expand** | [**Array<String>**](String.html)| which fields, if any, to expand | [optional]
{: class="table table-striped"}
### Return type
[**ContactListing**](ContactListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**NoteListing**](NoteListing.html) get_organizations_externalorganization_id_notes(external_organization_id, opts)
List Notes for an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization Id
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
sort_order: "sort_order_example" # String | Sort order
}
begin
#List Notes for an External Organization
result = api_instance.get_organizations_externalorganization_id_notes(external_organization_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations_externalorganization_id_notes: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization Id |
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**sort_order** | **String**| Sort order | [optional]
{: class="table table-striped"}
### Return type
[**NoteListing**](NoteListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) get_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id)
Fetch a note
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization Id
note_id = "note_id_example" # String | Note Id
begin
#Fetch a note
result = api_instance.get_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations_externalorganization_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization Id |
**note_id** | **String**| Note Id |
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**RelationshipListing**](RelationshipListing.html) get_organizations_externalorganization_id_relationships(external_organization_id, opts)
Fetch an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization ID
opts = {
page_size: 20, # Integer | Page size
page_number: 1, # Integer | Page number
sort_order: "sort_order_example" # String | Sort order
}
begin
#Fetch an External Organization
result = api_instance.get_organizations_externalorganization_id_relationships(external_organization_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_organizations_externalorganization_id_relationships: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization ID |
**page_size** | **Integer**| Page size | [optional] [default to 20]
**page_number** | **Integer**| Page number | [optional] [default to 1]
**sort_order** | **String**| Sort order | [optional]
{: class="table table-striped"}
### Return type
[**RelationshipListing**](RelationshipListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Relationship**](Relationship.html) get_relationships_relationship_id(relationship_id)
Fetch a relationship
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
relationship_id = "relationship_id_example" # String | Relationship Id
begin
#Fetch a relationship
result = api_instance.get_relationships_relationship_id(relationship_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->get_relationships_relationship_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**relationship_id** | **String**| Relationship Id |
{: class="table table-striped"}
### Return type
[**Relationship**](Relationship.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalContact**](ExternalContact.html) post_contacts(opts)
Create an ExternalContact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
opts = {
body: PureCloud::ExternalContact.new # ExternalContact | ExternalContact
}
begin
#Create an ExternalContact
result = api_instance.post_contacts(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->post_contacts: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ExternalContact**](ExternalContact.html)| ExternalContact | [optional]
{: class="table table-striped"}
### Return type
[**ExternalContact**](ExternalContact.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) post_contacts_contact_id_notes(contact_id, opts)
Create a Note for an ExternalContact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact Id
opts = {
body: PureCloud::Note.new # Note | ExternalContact
}
begin
#Create a Note for an ExternalContact
result = api_instance.post_contacts_contact_id_notes(contact_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->post_contacts_contact_id_notes: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact Id |
**body** | [**Note**](Note.html)| ExternalContact | [optional]
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalOrganization**](ExternalOrganization.html) post_organizations(opts)
Create an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
opts = {
body: PureCloud::ExternalOrganization.new # ExternalOrganization | ExternalOrganization
}
begin
#Create an External Organization
result = api_instance.post_organizations(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->post_organizations: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ExternalOrganization**](ExternalOrganization.html)| ExternalOrganization | [optional]
{: class="table table-striped"}
### Return type
[**ExternalOrganization**](ExternalOrganization.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) post_organizations_externalorganization_id_notes(external_organization_id, opts)
Create a Note for an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization Id
opts = {
body: PureCloud::Note.new # Note | ExternalContact
}
begin
#Create a Note for an External Organization
result = api_instance.post_organizations_externalorganization_id_notes(external_organization_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->post_organizations_externalorganization_id_notes: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization Id |
**body** | [**Note**](Note.html)| ExternalContact | [optional]
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Relationship**](Relationship.html) post_relationships(opts)
Create a relationship
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
opts = {
body: PureCloud::Relationship.new # Relationship | Relationship
}
begin
#Create a relationship
result = api_instance.post_relationships(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->post_relationships: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Relationship**](Relationship.html)| Relationship | [optional]
{: class="table table-striped"}
### Return type
[**Relationship**](Relationship.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalContact**](ExternalContact.html) put_contacts_contact_id(contact_id, opts)
Update a externalContact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact ID
opts = {
body: PureCloud::ExternalContact.new # ExternalContact | ExternalContact
}
begin
#Update a externalContact
result = api_instance.put_contacts_contact_id(contact_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->put_contacts_contact_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact ID |
**body** | [**ExternalContact**](ExternalContact.html)| ExternalContact | [optional]
{: class="table table-striped"}
### Return type
[**ExternalContact**](ExternalContact.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) put_contacts_contact_id_notes_note_id(contact_id, note_id, opts)
Update a note for a contact
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
contact_id = "contact_id_example" # String | ExternalContact Id
note_id = "note_id_example" # String | Note Id
opts = {
body: PureCloud::Note.new # Note | Note
}
begin
#Update a note for a contact
result = api_instance.put_contacts_contact_id_notes_note_id(contact_id, note_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->put_contacts_contact_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact_id** | **String**| ExternalContact Id |
**note_id** | **String**| Note Id |
**body** | [**Note**](Note.html)| Note | [optional]
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**ExternalOrganization**](ExternalOrganization.html) put_organizations_externalorganization_id(external_organization_id, opts)
Update an External Organization
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization ID
opts = {
body: PureCloud::ExternalOrganization.new # ExternalOrganization | ExternalOrganization
}
begin
#Update an External Organization
result = api_instance.put_organizations_externalorganization_id(external_organization_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->put_organizations_externalorganization_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization ID |
**body** | [**ExternalOrganization**](ExternalOrganization.html)| ExternalOrganization | [optional]
{: class="table table-striped"}
### Return type
[**ExternalOrganization**](ExternalOrganization.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Note**](Note.html) put_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id, opts)
Update a note
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
external_organization_id = "external_organization_id_example" # String | External Organization Id
note_id = "note_id_example" # String | Note Id
opts = {
body: PureCloud::Note.new # Note | Note
}
begin
#Update a note
result = api_instance.put_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->put_organizations_externalorganization_id_notes_note_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**external_organization_id** | **String**| External Organization Id |
**note_id** | **String**| Note Id |
**body** | [**Note**](Note.html)| Note | [optional]
{: class="table table-striped"}
### Return type
[**Note**](Note.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**Relationship**](Relationship.html) put_relationships_relationship_id(relationship_id, opts)
Update a relationship
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::ExternalContactsApi.new
relationship_id = "relationship_id_example" # String | Relationship Id
opts = {
body: PureCloud::Relationship.new # Relationship | Relationship
}
begin
#Update a relationship
result = api_instance.put_relationships_relationship_id(relationship_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling ExternalContactsApi->put_relationships_relationship_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**relationship_id** | **String**| Relationship Id |
**body** | [**Relationship**](Relationship.html)| Relationship | [optional]
{: class="table table-striped"}
### Return type
[**Relationship**](Relationship.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json