Skip to content

Latest commit

 

History

History
250 lines (172 loc) · 5.76 KB

ContactApi.md

File metadata and controls

250 lines (172 loc) · 5.76 KB

TripletexApi::ContactApi

All URIs are relative to https://tripletex.no/v2

Method HTTP request Description
get GET /contact/{id} Get contact by ID.
post POST /contact Create contact.
put PUT /contact/{id} [BETA] Update contact.
search GET /contact Find contacts corresponding with sent data.

get

ResponseWrapperContact get(id, opts)

Get contact by ID.

Example

# load the gem
require 'tripletex_api'
# setup authorization
TripletexApi.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = TripletexApi::ContactApi.new

id = 56 # Integer | Element ID

opts = { 
  fields: "fields_example" # String | Fields filter pattern
}

begin
  #Get contact by ID.
  result = api_instance.get(id, opts)
  p result
rescue TripletexApi::ApiError => e
  puts "Exception when calling ContactApi->get: #{e}"
end

Parameters

Name Type Description Notes
id Integer Element ID
fields String Fields filter pattern [optional]

Return type

ResponseWrapperContact

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

post

ResponseWrapperContact post(opts)

Create contact.

Example

# load the gem
require 'tripletex_api'
# setup authorization
TripletexApi.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = TripletexApi::ContactApi.new

opts = { 
  body: TripletexApi::Contact.new # Contact | JSON representing the new object to be created. Should not have ID and version set.
}

begin
  #Create contact.
  result = api_instance.post(opts)
  p result
rescue TripletexApi::ApiError => e
  puts "Exception when calling ContactApi->post: #{e}"
end

Parameters

Name Type Description Notes
body Contact JSON representing the new object to be created. Should not have ID and version set. [optional]

Return type

ResponseWrapperContact

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

put

ResponseWrapperContact put(id, opts)

[BETA] Update contact.

Example

# load the gem
require 'tripletex_api'
# setup authorization
TripletexApi.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = TripletexApi::ContactApi.new

id = 56 # Integer | Element ID

opts = { 
  body: TripletexApi::Contact.new # Contact | Partial object describing what should be updated
}

begin
  #[BETA] Update contact.
  result = api_instance.put(id, opts)
  p result
rescue TripletexApi::ApiError => e
  puts "Exception when calling ContactApi->put: #{e}"
end

Parameters

Name Type Description Notes
id Integer Element ID
body Contact Partial object describing what should be updated [optional]

Return type

ResponseWrapperContact

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

search

ListResponseContact search(opts)

Find contacts corresponding with sent data.

Example

# load the gem
require 'tripletex_api'
# setup authorization
TripletexApi.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = TripletexApi::ContactApi.new

opts = { 
  id: "id_example", # String | List of IDs
  first_name: "first_name_example", # String | Containing
  last_name: "last_name_example", # String | Containing
  email: "email_example", # String | Containing
  customer_id: "customer_id_example", # String | List of IDs
  from: 0, # Integer | From index
  count: 1000, # Integer | Number of elements to return
  sorting: "sorting_example", # String | Sorting pattern
  fields: "fields_example" # String | Fields filter pattern
}

begin
  #Find contacts corresponding with sent data.
  result = api_instance.search(opts)
  p result
rescue TripletexApi::ApiError => e
  puts "Exception when calling ContactApi->search: #{e}"
end

Parameters

Name Type Description Notes
id String List of IDs [optional]
first_name String Containing [optional]
last_name String Containing [optional]
email String Containing [optional]
customer_id String List of IDs [optional]
from Integer From index [optional] [default to 0]
count Integer Number of elements to return [optional] [default to 1000]
sorting String Sorting pattern [optional]
fields String Fields filter pattern [optional]

Return type

ListResponseContact

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined