<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using wxc_sdk - create or update workspace, supplying parameters in Webex for Developers</title>
    <link>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5129186#M3131</link>
    <description>&lt;P&gt;Hi Rudrakshi,&lt;/P&gt;&lt;P&gt;The wxc_sdk was created by&amp;nbsp;Johannes Krohn, Principal Technical Marketing Engineer,&amp;nbsp;Cisco and is publically available at&amp;nbsp;&amp;nbsp;&lt;A href="https://wxc-sdk.readthedocs.io/en/latest/index.html#" target="_blank"&gt;wxc_sdk — wxc_sdk 1.19.0 documentation (wxc-sdk.readthedocs.io)&lt;/A&gt;. It was just what I was looking for as it allows me to use APIs to perform scripted changes to many workspaces globally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I got was down to a lack of&amp;nbsp; knowledge of python and coding. I managed to get the update API working by following the code in another example script found in the sdk.&lt;/P&gt;&lt;P&gt;After changing my code to below, the workspace updated ok.&lt;/P&gt;&lt;P&gt;from wxc_sdk.workspaces import Workspace, WorkspaceSupportedDevices, CallingType, WorkspaceCalling&lt;BR /&gt;workspaceid = "abc123xyz789"&lt;BR /&gt;update = Workspace()&lt;BR /&gt;update.capacity = 4&lt;BR /&gt;api.workspaces.update(workspace_id=workspaceid, settings=update)&lt;/P&gt;&lt;P&gt;[I managed to get the Integration and OAuth access token working just fine following the guidelines in the wxc_sdk].&lt;/P&gt;&lt;P&gt;Unfortunately I came across another issue to with updating workspaces that are configured with hybrid calling which i will post separately.&lt;/P&gt;&lt;P&gt;Many thxs&lt;/P&gt;&lt;P&gt;.. Sanjay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 17:34:25 GMT</pubDate>
    <dc:creator>SPatel19</dc:creator>
    <dc:date>2024-06-12T17:34:25Z</dc:date>
    <item>
      <title>Using wxc_sdk - create or update workspace, supplying parameters</title>
      <link>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5128552#M3125</link>
      <description>&lt;P&gt;Hello Devnet,&lt;/P&gt;&lt;P&gt;I am new to using Webex APIs and&amp;nbsp; Python. I have followed "Agile Management of Webex Calling - There's an API for that – BRKCOL-3015 " and managed to setup Pycharm and load the wxc_sdk api's. I have successfully connected to my organisation using a service app. I have used and modified the service_app.py example script and can read a workspace setting. My problem comes when trying to create or update a workspace - i cannot seem to write the correct python code to parse the settings parameters when calling the update workspace API.&lt;BR /&gt;I used the list workspace api&amp;nbsp; to obtain the&amp;nbsp; workspace settings&amp;nbsp; and was going&amp;nbsp; modify the capacity&amp;nbsp; parameter&amp;nbsp; to 1 and them back using the update api.&lt;/P&gt;&lt;P&gt;workspaceid = "Y2lzY29zcG.....MA=="&lt;BR /&gt;wspacedetail = list(api.workspaces.details(workspace_id=workspaceid))&lt;BR /&gt;print(f'{len(wspacedetail)} wspacedetail')&lt;/P&gt;&lt;P&gt;Using the above script works fine - I used the output and&amp;nbsp; tried passing the modified capacity parameter as below&lt;/P&gt;&lt;P&gt;newsettings = \&lt;BR /&gt;{&lt;BR /&gt;"org_id:": "&amp;lt;omitted&amp;gt;",&lt;BR /&gt;"location_id": "&amp;lt;omitted&amp;gt;",&lt;BR /&gt;"floor_id": "&amp;lt;omitted&amp;gt;",&lt;BR /&gt;"display_name": "London AV Test",&lt;BR /&gt;"capacity": 1,&lt;BR /&gt;"workspace_type": "meetingRoom",&lt;BR /&gt;"sip_address": "london_av_test@l&amp;lt;redacted&amp;gt;.rooms.webex.com",&lt;BR /&gt;"created": "2024-03-22T11:28:55.771Z",&lt;BR /&gt;"calling": {"type": "hybrid_Calling",&lt;BR /&gt;"hybrid_Calling": {"emailAddress": "london-s3.dx80test@&amp;lt;redacted&amp;gt;.com"}},&lt;BR /&gt;"calendar": {"type": "microsoft", "emailAddress": "london_s3dx80test@&amp;lt;redacted&amp;gt;.com"},&lt;BR /&gt;"hotdesking_Status": "off",&lt;BR /&gt;# "deviceHostedMeetings": {"enabled": false },&lt;BR /&gt;"supported_Devices": "collaborationDevices",&lt;BR /&gt;"device_Platform": "cisco"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;wsupdate=api.workspaces.update(workspace_id=workspaceid, settings=newsettings)&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;However when running the script, i get an error returned&lt;/P&gt;&lt;P&gt;WARNING:wxc_sdk.base:auto enhancing Enum CallingType, new value: hybridCalling&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\&amp;lt;redacted&amp;gt;\PycharmProjects\WxC-pythonProject\.venv\wxcupdate_app.py", line 196, in &amp;lt;module&amp;gt;&lt;BR /&gt;wxcupdate_app()&lt;BR /&gt;File "C:\Users\&amp;lt;redacted&amp;gt;\PycharmProjects\WxC-pythonProject\.venv\wxcupdate_app.py", line 184, in wxcupdate_app&lt;BR /&gt;wsupdate=api.workspaces.update(workspace_id=workspaceid, settings=newsettings)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "C:\Users\&amp;lt;redacted&amp;gt;\PycharmProjects\WxC-pythonProject\.venv\Lib\site-packages\wxc_sdk\workspaces\__init__.py", line 413, in update&lt;BR /&gt;j_data = settings.update_or_create(for_update=True)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;AttributeError: 'dict' object has no attribute 'update_or_create'&lt;/P&gt;&lt;P&gt;I have tried digging down deeper into the class object, but cannot determine how to write the correct python code&amp;nbsp; to pass the workspace settings when calling the update api.&amp;nbsp;&lt;BR /&gt;I cannot find any other example scripts to follow either.&lt;BR /&gt;Can anyone help and let me know how the code should be written or point me in the write direction?&lt;/P&gt;&lt;P&gt;thxs&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 13:16:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5128552#M3125</guid>
      <dc:creator>SPatel19</dc:creator>
      <dc:date>2024-06-11T13:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using wxc_sdk - create or update workspace, supplying parameters</title>
      <link>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5128933#M3129</link>
      <description>&lt;P&gt;Hi Sanjay,&lt;/P&gt;
&lt;P&gt;It seems you're using some third party python SDK which I'm not aware of and our team also doesn't support it. The error "&lt;SPAN&gt;AttributeError: 'dict' object has no attribute 'update_or_create'&lt;/SPAN&gt;" is very specific to the library that you're using.&lt;/P&gt;
&lt;P&gt;I would suggest you go through our documentation here:&amp;nbsp;&lt;A href="https://developer.webex.com/docs" target="_blank"&gt;https://developer.webex.com/docs&lt;/A&gt;&amp;nbsp;to build understanding around the APIs and test these using postman. You can get the personal access token here:&amp;nbsp;&lt;A href="https://developer.webex.com/docs/getting-started," target="_blank"&gt;https://developer.webex.com/docs/getting-started,&lt;/A&gt;&amp;nbsp;which is a temporary token and would only be valid till 12 Hours max or until the user is logged in (whichever is less).&lt;/P&gt;
&lt;P&gt;In order to automate the workflow of calling APIs for an app, it is recommended to use Integration and generate OAuth access token instead of personal access token. The validity for OAuth access token is 14 days and you can use refresh token to generate new access token programmatically. You can read more about Integrations here:&amp;nbsp;&lt;A href="https://developer.webex.com/docs/integrations" target="_blank"&gt;https://developer.webex.com/docs/integrations&lt;/A&gt;&amp;nbsp;and also review this article:&amp;nbsp;&lt;A href="https://developer.webex.com/blog/real-world-walkthrough-of-building-an-oauth-webex-integration," target="_blank"&gt;https://developer.webex.com/blog/real-world-walkthrough-of-building-an-oauth-webex-integration,&lt;/A&gt;&amp;nbsp;which has demonstrated how to work with integrations using Python sample code.&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 10:18:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5128933#M3129</guid>
      <dc:creator>Rudrakshi</dc:creator>
      <dc:date>2024-06-12T10:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using wxc_sdk - create or update workspace, supplying parameters</title>
      <link>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5129186#M3131</link>
      <description>&lt;P&gt;Hi Rudrakshi,&lt;/P&gt;&lt;P&gt;The wxc_sdk was created by&amp;nbsp;Johannes Krohn, Principal Technical Marketing Engineer,&amp;nbsp;Cisco and is publically available at&amp;nbsp;&amp;nbsp;&lt;A href="https://wxc-sdk.readthedocs.io/en/latest/index.html#" target="_blank"&gt;wxc_sdk — wxc_sdk 1.19.0 documentation (wxc-sdk.readthedocs.io)&lt;/A&gt;. It was just what I was looking for as it allows me to use APIs to perform scripted changes to many workspaces globally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I got was down to a lack of&amp;nbsp; knowledge of python and coding. I managed to get the update API working by following the code in another example script found in the sdk.&lt;/P&gt;&lt;P&gt;After changing my code to below, the workspace updated ok.&lt;/P&gt;&lt;P&gt;from wxc_sdk.workspaces import Workspace, WorkspaceSupportedDevices, CallingType, WorkspaceCalling&lt;BR /&gt;workspaceid = "abc123xyz789"&lt;BR /&gt;update = Workspace()&lt;BR /&gt;update.capacity = 4&lt;BR /&gt;api.workspaces.update(workspace_id=workspaceid, settings=update)&lt;/P&gt;&lt;P&gt;[I managed to get the Integration and OAuth access token working just fine following the guidelines in the wxc_sdk].&lt;/P&gt;&lt;P&gt;Unfortunately I came across another issue to with updating workspaces that are configured with hybrid calling which i will post separately.&lt;/P&gt;&lt;P&gt;Many thxs&lt;/P&gt;&lt;P&gt;.. Sanjay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 17:34:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/using-wxc-sdk-create-or-update-workspace-supplying-parameters/m-p/5129186#M3131</guid>
      <dc:creator>SPatel19</dc:creator>
      <dc:date>2024-06-12T17:34:25Z</dc:date>
    </item>
  </channel>
</rss>

