--- title: ScriptsApi --- ## PureCloud::ScriptsApi All URIs are relative to *https://api.mypurecloud.com* Method | HTTP request | Description ------------- | ------------- | ------------- |[**get_published**](ScriptsApi.html#get_published) | **GET** /api/v2/scripts/published | Get the published scripts.| |[**get_published_script_id**](ScriptsApi.html#get_published_script_id) | **GET** /api/v2/scripts/published/{scriptId} | Get the published script.| |[**get_published_script_id_pages**](ScriptsApi.html#get_published_script_id_pages) | **GET** /api/v2/scripts/published/{scriptId}/pages | Get the list of published pages| |[**get_published_script_id_pages_page_id**](ScriptsApi.html#get_published_script_id_pages_page_id) | **GET** /api/v2/scripts/published/{scriptId}/pages/{pageId} | Get the published page.| |[**get_published_script_id_variables**](ScriptsApi.html#get_published_script_id_variables) | **GET** /api/v2/scripts/published/{scriptId}/variables | Get the published variables| |[**get_script_id**](ScriptsApi.html#get_script_id) | **GET** /api/v2/scripts/{scriptId} | Get a script| |[**get_script_id_pages**](ScriptsApi.html#get_script_id_pages) | **GET** /api/v2/scripts/{scriptId}/pages | Get the list of pages| |[**get_script_id_pages_page_id**](ScriptsApi.html#get_script_id_pages_page_id) | **GET** /api/v2/scripts/{scriptId}/pages/{pageId} | Get a page| |[**get_scripts**](ScriptsApi.html#get_scripts) | **GET** /api/v2/scripts | Get the list of scripts| {: class="table table-striped"} ## -[**ScriptEntityListing**](ScriptEntityListing.html) get_published(opts) Get the published scripts. ### 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::ScriptsApi.new opts = { page_size: 25, # Integer | Page size page_number: 1, # Integer | Page number expand: "expand_example", # String | Expand name: "name_example", # String | Name filter feature: "feature_example", # String | Feature filter flow_id: "flow_id_example" # String | Secure flow id filter } begin #Get the published scripts. result = api_instance.get_published(opts) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_published: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page_size** | **Integer**| Page size | [optional] [default to 25] **page_number** | **Integer**| Page number | [optional] [default to 1] **expand** | **String**| Expand | [optional] **name** | **String**| Name filter | [optional] **feature** | **String**| Feature filter | [optional] **flow_id** | **String**| Secure flow id filter | [optional] {: class="table table-striped"} ### Return type [**ScriptEntityListing**](ScriptEntityListing.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Script**](Script.html) get_published_script_id(script_id) Get the published script. ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID begin #Get the published script. result = api_instance.get_published_script_id(script_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_published_script_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | {: class="table table-striped"} ### Return type [**Script**](Script.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Array<Page>**](Page.html) get_published_script_id_pages(script_id) Get the list of published pages ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID begin #Get the list of published pages result = api_instance.get_published_script_id_pages(script_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_published_script_id_pages: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | {: class="table table-striped"} ### Return type [**Array<Page>**](Page.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Page**](Page.html) get_published_script_id_pages_page_id(script_id, page_id) Get the published page. ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID page_id = "page_id_example" # String | Page ID begin #Get the published page. result = api_instance.get_published_script_id_pages_page_id(script_id, page_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_published_script_id_pages_page_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | **page_id** | **String**| Page ID | {: class="table table-striped"} ### Return type [**Page**](Page.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -Object** get_published_script_id_variables(script_id) Get the published variables ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID begin #Get the published variables result = api_instance.get_published_script_id_variables(script_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_published_script_id_variables: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | {: class="table table-striped"} ### Return type **Object** ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Script**](Script.html) get_script_id(script_id) Get a script ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID begin #Get a script result = api_instance.get_script_id(script_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_script_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | {: class="table table-striped"} ### Return type [**Script**](Script.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Array<Page>**](Page.html) get_script_id_pages(script_id) Get the list of pages ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID begin #Get the list of pages result = api_instance.get_script_id_pages(script_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_script_id_pages: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | {: class="table table-striped"} ### Return type [**Array<Page>**](Page.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Page**](Page.html) get_script_id_pages_page_id(script_id, page_id) Get a page ### 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::ScriptsApi.new script_id = "script_id_example" # String | Script ID page_id = "page_id_example" # String | Page ID begin #Get a page result = api_instance.get_script_id_pages_page_id(script_id, page_id) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_script_id_pages_page_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **script_id** | **String**| Script ID | **page_id** | **String**| Page ID | {: class="table table-striped"} ### Return type [**Page**](Page.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**ScriptEntityListing**](ScriptEntityListing.html) get_scripts(opts) Get the list of scripts ### 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::ScriptsApi.new opts = { page_size: 25, # Integer | Page size page_number: 1, # Integer | Page number expand: "expand_example", # String | Expand name: "name_example", # String | Name filter feature: "feature_example", # String | Feature filter flow_id: "flow_id_example", # String | Secure flow id filter sort_by: "sort_by_example", # String | SortBy sort_order: "sort_order_example" # String | SortOrder } begin #Get the list of scripts result = api_instance.get_scripts(opts) p result rescue PureCloud::ApiError => e puts "Exception when calling ScriptsApi->get_scripts: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page_size** | **Integer**| Page size | [optional] [default to 25] **page_number** | **Integer**| Page number | [optional] [default to 1] **expand** | **String**| Expand | [optional] **name** | **String**| Name filter | [optional] **feature** | **String**| Feature filter | [optional] **flow_id** | **String**| Secure flow id filter | [optional] **sort_by** | **String**| SortBy | [optional] **sort_order** | **String**| SortOrder | [optional] {: class="table table-striped"} ### Return type [**ScriptEntityListing**](ScriptEntityListing.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json