### Start Agent Containers Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-demo-setup-guide.md Commands to start the agent containers using the setup script for either Podman or Docker environments. ```shell # Podman ./setup_agent.sh --start # Docker sudo ./setup_agent.sh --start ``` -------------------------------- ### Get File Metadata SDK Examples Source: https://help.moveworks.com/api-reference/content-gateway/content-gateway/get-file-metadata-and-html-content-body.md Implementation examples for retrieving file metadata across multiple programming languages. ```python import requests url = "https://content-gateway-example.com/v1/files/id" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/files/id'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/files/id" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/files/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/files/id") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/files/id'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/files/id"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/files/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Run the Agent Installer Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-demo-setup-guide.md Executes the setup script for the chosen container runtime. Podman is recommended for rootless execution. ```shell # Podman (recommended — no root required) ./setup_agent.sh --podman ``` ```shell # Docker sudo ./setup_agent.sh --docker ``` -------------------------------- ### Initialize and Start Gateway Server Source: https://help.moveworks.com/ai-assistant/enterprise-search/starter-code.md Commands to clone the repository, install dependencies, generate an API key, and launch the gateway server. ```bash # Clone the repo git clone https://github.com/moveworks/gateway.git cd gateway/starter-code # Install dependencies pip install -r requirements.txt # Generate a gateway API key (save this. You'll need it in Moveworks Setup) python -c "import secrets; print(secrets.token_hex(32))" # Start the server GATEWAY_API_KEY= python content_gateway.py ``` -------------------------------- ### Docker service startup error logs Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-troubleshooting.md Example output when the Docker service fails to initialize during agent setup. ```shell Failed to enable unit: Unit file docker service does not exist [ERROR] Error enabling Docker service to start on boot Failed to start Docker service: Unit docker service not found [ERROR] Error starting Docker service ``` -------------------------------- ### Get Form by ID SDK Examples Source: https://help.moveworks.com/api-reference/legacy-gateways/forms-gateway/smart-forms/get-form-by-id.md Implementation examples for retrieving a form using various programming languages and HTTP clients. ```python import requests url = "http://localhost:5000/myinstance1/forms/formId" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'http://localhost:5000/myinstance1/forms/formId'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "http://localhost:5000/myinstance1/forms/formId" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("http://localhost:5000/myinstance1/forms/formId") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("http://localhost:5000/myinstance1/forms/formId") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'http://localhost:5000/myinstance1/forms/formId', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://localhost:5000/myinstance1/forms/formId"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5000/myinstance1/forms/formId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Get User by ID API Client Examples Source: https://help.moveworks.com/api-reference/legacy-gateways/identity-gateway/get-user-by-id.md Code examples for performing a GET request to retrieve user information using various SDKs and standard libraries. ```python import requests url = "http://localhost:5000/myinstance1/users/userId" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'http://localhost:5000/myinstance1/users/userId'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "http://localhost:5000/myinstance1/users/userId" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("http://localhost:5000/myinstance1/users/userId") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("http://localhost:5000/myinstance1/users/userId") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'http://localhost:5000/myinstance1/users/userId', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://localhost:5000/myinstance1/users/userId"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5000/myinstance1/users/userId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Download File via SDKs Source: https://help.moveworks.com/api-reference/content-gateway/content-gateway/download-file.md Examples demonstrating how to perform a GET request to the download endpoint using standard HTTP client libraries. ```python import requests url = "https://content-gateway-example.com/v1/files/id/download" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/files/id/download'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/files/id/download" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/files/id/download") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/files/id/download") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/files/id/download'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/files/id/download"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/files/id/download")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Start the Moveworks Agent Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-installation-guide.md Initiates the agent service using the setup script with root privileges. ```shell sudo ./setup_agent.sh --start ``` -------------------------------- ### SDK Examples for Testing Authentication Source: https://help.moveworks.com/api-reference/events-api/events-api/authentication/test-auth.md Code examples in various programming languages to perform a GET request to the authentication test endpoint. ```python import requests url = "https://api.moveworks.ai/rest/v1/auth/test" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1/auth/test'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.moveworks.ai/rest/v1/auth/test" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.moveworks.ai/rest/v1/auth/test") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.moveworks.ai/rest/v1/auth/test") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.moveworks.ai/rest/v1/auth/test', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.moveworks.ai/rest/v1/auth/test"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1/auth/test")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Action Usage Example Source: https://help.moveworks.com/agent-studio/actions/compound-actions/compound-action-syntax-reference.md A practical example of fetching user details with a 10-second delay and progress notifications. ```yaml action: action_name: fetch_user_details # Example action_name for fetching user details output_key: user_details input_args: user_id: data.user_id # Assuming user_id is stored in data delay_config: seconds: "10" # Wait 10 seconds to execute the action progress_updates: on_pending: "Fetching user details, please wait..." on_complete: "User details fetched successfully." ``` -------------------------------- ### Initiate Agent Reconfiguration via CLI Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-configuration-guides/reconfiguring-an-existing-agent.md Use the --reconfigure flag with the setup script to start the reconfiguration process. ```bash ./setup_agent.sh -r # or ./setup_agent.sh --reconfigure ``` -------------------------------- ### Create Response Stream SDK Examples Source: https://help.moveworks.com/api-reference/beta-conversations-api/responses/create-response-stream.md Implementation examples for streaming responses using Python and JavaScript. ```python import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/stream" payload = { "body": { "input": { "text": "Who does John Doe report to?" } } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/stream'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"body":{"input":{"text":"Who does John Doe report to?"}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### List Groups SDK Examples Source: https://help.moveworks.com/api-reference/content-gateway/content-gateway/list-groups.md Implementation examples for retrieving groups using various programming languages. ```python import requests url = "https://content-gateway-example.com/v1/groups" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/groups'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/groups" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/groups") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/groups") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/groups'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/groups"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/groups")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Install Azure CLI on Linux Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-configuration-guides/azure-key-vault.md Install the Azure CLI tool on the VM using the official installation script. ```bash curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash ``` -------------------------------- ### Submit Feedback SDK Examples Source: https://help.moveworks.com/api-reference/beta-conversations-api/messages/submit-feedback.md Implementation examples for submitting feedback using various programming languages. ```python import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback" payload = { "callback_id": "eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0", "additional_feedback": "The response answered my question clearly." } headers = { "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback'; const options = { method: 'POST', headers: { 'Assistant-Name': 'acmecorp-conversations-rest-api', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"callback_id":"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0","additional_feedback":"The response answered my question clearly."}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback" payload := strings.NewReader("{\n \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n \"additional_feedback\": \"The response answered my question clearly.\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Assistant-Name"] = 'acmecorp-conversations-rest-api' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n \"additional_feedback\": \"The response answered my question clearly.\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback") .header("Assistant-Name", "acmecorp-conversations-rest-api") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"callback_id\": \"eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0\",\n \"additional_feedback\": \"The response answered my question clearly.\"\n}") .asString(); ``` ```php request('POST', 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/feedback', [ 'body' => '{ "callback_id": "eyJhY3Rpb24iOiJoZWxwZnVsIi4uLn0", "additional_feedback": "The response answered my question clearly." }', 'headers' => [ 'Assistant-Name' => 'acmecorp-conversations-rest-api', 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` -------------------------------- ### Create Conversation SDK Examples Source: https://help.moveworks.com/api-reference/beta-conversations-api/conversations/create-conversation.md Implementation examples for creating a conversation across multiple programming languages. ```python import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations" payload = { "title": "Help with user permissions" } headers = { "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1beta1/conversations'; const options = { method: 'POST', headers: { 'Assistant-Name': 'acmecorp-conversations-rest-api', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"title":"Help with user permissions"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.moveworks.ai/rest/v1beta1/conversations" payload := strings.NewReader("{\n \"title\": \"Help with user permissions\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.moveworks.ai/rest/v1beta1/conversations") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Assistant-Name"] = 'acmecorp-conversations-rest-api' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"title\": \"Help with user permissions\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.moveworks.ai/rest/v1beta1/conversations") .header("Assistant-Name", "acmecorp-conversations-rest-api") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"title\": \"Help with user permissions\"\n}") .asString(); ``` ```php request('POST', 'https://api.moveworks.ai/rest/v1beta1/conversations', [ 'body' => '{ "title": "Help with user permissions" }', 'headers' => [ 'Assistant-Name' => 'acmecorp-conversations-rest-api', 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.moveworks.ai/rest/v1beta1/conversations"); var request = new RestRequest(Method.POST); request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"title\": \"Help with user permissions\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["title": "Help with user permissions"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1beta1/conversations")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Initiate script configuration Source: https://help.moveworks.com/ai-assistant/data-api/getting-started-build-your-integration-with-data-api.md Run the setup command to provide API keys and Snowflake connection details for the first time. ```bash python3 main-script.py setup ``` ```powershell python main-script.py setup ``` -------------------------------- ### Initiate Interactive Setup Wizard Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-configuration-guides/reconfiguring-an-existing-agent.md Run the setup script with the --docker flag to enter the interactive wizard for editing existing configurations. ```bash ./setup_agent.sh --docker ... Configuration file found. Do you want to set a new configuration? [y/n]: n Do you want to edit the existing config file? [y/n]: y ... Starting bond configurator with --reconfigure ``` -------------------------------- ### Run the installation script Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-installation-guide.md Execute the script using either Docker or Podman. Use sudo for Docker deployments. ```shell sudo ./setup_agent.sh --docker ``` ```shell ./setup_agent.sh --podman ``` ```shell sudo ./setup_agent.sh --docker --host-network ``` -------------------------------- ### Docker or Podman installation failure messages Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-troubleshooting.md Error messages displayed when the setup script fails to automatically install container runtimes. ```text Error installing Podman. Install Podman and Rerun Error installing Docker, Install Docker and Rerun ``` -------------------------------- ### Example User Query Source: https://help.moveworks.com/ai-assistant/productivity-boost/brief-me-assistant/brief-me-configuration.md Sample input to test the Brief Me functionality after configuration. ```text “What can I do with brief me?” ``` -------------------------------- ### Download Agent Installation Script Source: https://help.moveworks.com/agent-studio/core-platform/moveworks-agent/moveworks-agent-configuration-guides/upgrade-an-existing-agent.md Use curl or wget to download the setup_agent.sh script if it is missing from the deployment environment. ```shell curl -fsSL https://get-agent.moveworks.com > setup_agent.sh ``` ```shell wget https://get-agent.moveworks.com/ --output-document setup_agent.sh ``` -------------------------------- ### List Range Accessor Examples Source: https://help.moveworks.com/agent-studio/core-platform/configuration-languages/moveworks-dsl-reference.md Slicing lists using start and stop indices. ```jsx items[:3] ``` ```text [10, 20, 30] ``` ```jsx $["12months"][2:5] ``` ```text ["Mar", "Apr", "May"] ``` ```jsx $["12months"][-3:] ``` ```text ["Oct", "Nov", "Dec"] ``` -------------------------------- ### Switch Access Level Welcome Example Source: https://help.moveworks.com/agent-studio/actions/compound-actions/compound-action-syntax-reference.md Demonstrates routing different welcome actions based on the user's access level attribute. ```yaml switch: cases: - condition: data.user.access_level == 'admin' steps: - action: action_name: send_admin_welcome output_key: admin_welcome_notification input_args: user_id: data.user.id message: "Welcome, Admin! You have full access to the admin dashboard." - condition: data.user.access_level == 'member' steps: - action: action_name: send_member_welcome output_key: member_welcome_notification input_args: user_id: data.user.id message: "Welcome, Member! Explore your member benefits in your profile." default: steps: - action: action_name: send_generic_access_notification output_key: generic_access_notification input_args: user_id: data.user.id message: "You're set! Start exploring your new account." ``` -------------------------------- ### Basic Action Handoff Example Source: https://help.moveworks.com/agent-studio/actions/compound-actions/return.md Demonstrates returning aggregated results from multiple preceding actions. ```yaml steps: - action: action_name: fetch_data_one output_key: action_output_one # e.g., { "status": "success", "data": { ... } } - action: action_name: fetch_data_two output_key: action_output_two # e.g., { "priority": "2" } - return: output_mapper: output_one: data.action_output_one output_two: data.action_output_two ``` ```json { "output_one": { "status": "success", "data": { "value": 42, "description": "The answer to life, the universe, and everything." } }, "output_two": { "priority": "2" } } ``` -------------------------------- ### List Forms HTTP Request Source: https://help.moveworks.com/api-reference/legacy-gateways/forms-gateway/smart-forms/list-forms.md Example of the GET request used to retrieve forms from the gateway. ```http GET http://localhost:5000/myinstance1/forms ``` -------------------------------- ### Set up Python virtual environment Source: https://help.moveworks.com/ai-assistant/data-api/getting-started-build-your-integration-with-data-api.md Create and activate a virtual environment to manage project dependencies. ```bash python3 -m venv moveworks_env source moveworks_env/bin/activate ``` -------------------------------- ### List Users Request Example Source: https://help.moveworks.com/api-reference/legacy-gateways/identity-gateway/list-users.md A basic HTTP GET request to retrieve the list of users from the identity gateway. ```http GET http://localhost:5000/myinstance1/users ``` -------------------------------- ### GET moveworks/base/version Source: https://help.moveworks.com/ai-assistant/enterprise-search/content-integrations/content-integration-servicenow/acl-platform-permissions-update-set-module.md Retrieves the version information for each installed Update Set Module and current system property values. ```APIDOC ## GET /api/{namespace}/moveworks/base/version ### Description This endpoint returns the versioning information for installed Update Set Modules and the current values of system properties for audit and validation purposes. ### Method GET ### Endpoint /api/{namespace}/moveworks/base/version ### Response #### Success Response (200) - **result** (object) - Contains the versioning details and system properties. #### Response Example { "result": { "apis": { "GET /api/488834/moveworks/acl/get_access_info": "2021-02-23 04:56:42", "PUT /api/488834/moveworks/acl/config": "2021-02-23 04:56:40", "GET /api/488834/moveworks/base/version": "2021-02-23 04:49:37", "POST /api/488834/moveworks/dev_essentials/bypass": "2021-02-23 04:35:25", "PUT /api/488834/moveworks/dev_essentials/bypass": "2021-02-23 04:35:24" }, "properties": { "moveworks.acl.check_legacy_entitlements": "false", "moveworks.acl.version": "1.0.0", "moveworks.base.api.sys_id": "aaf4178a1b85d4105394fc88cc4bcbc8", "moveworks.base.version": "1.0.0", "moveworks.dev_essentials.version": "0.0.1", "moveworks.logging.version": "1.0.0" } } } ``` -------------------------------- ### Manage Attribute Configuration Source: https://help.moveworks.com/agent-studio/core-platform/user-identity/mw-setup-identity/user-ingestion-filters-guide.md Examples showing how to correctly update attribute lists to avoid dropping existing fields. ```text Attributes: (empty) ``` ```text Attributes: department ``` ```text Attributes: mail, displayName, givenName, surname, jobTitle, department, officeLocation, mobilePhone, employeeId, manager.displayName ``` -------------------------------- ### Slack API Response for Team List Source: https://help.moveworks.com/ai-assistant/chat-platform-experiences/slack.md Example JSON response showing the list of teams associated with the Enterprise Grid installation. ```json { "ok": true, "teams": [ { "id": "T123MW45", "name": "org" } ] } ``` ```json { "ok": true, "teams": [ { "id": "T123MW45", "name": "CS Org" }, { "id": "T098MW78", "name": "All Company" }, ] } ``` -------------------------------- ### List Users SDK Examples Source: https://help.moveworks.com/api-reference/content-gateway/content-gateway/list-users.md Code examples for fetching the user list using various programming languages. ```python import requests url = "https://content-gateway-example.com/v1/users" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/users'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/users" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/users") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/users") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/users'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/users"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/users")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### List Files SDK Implementations Source: https://help.moveworks.com/api-reference/content-gateway/content-gateway/list-files.md Examples of how to perform a GET request to the list files endpoint using various programming languages. ```python import requests url = "https://content-gateway-example.com/v1/files" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/files'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/files" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/files") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/files'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/files"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/files")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```