{"action":"created","issue":{"url":"https://api.github.com/repos/MattParr/python-atws/issues/50","repository_url":"https://api.github.com/repos/MattParr/python-atws","labels_url":"https://api.github.com/repos/MattParr/python-atws/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/MattParr/python-atws/issues/50/comments","events_url":"https://api.github.com/repos/MattParr/python-atws/issues/50/events","html_url":"https://github.com/MattParr/python-atws/issues/50","id":350314820,"node_id":"MDU6SXNzdWUzNTAzMTQ4MjA=","number":50,"title":"How can I create a multi-site ?","user":{"login":"mcl12345","id":24854693,"node_id":"MDQ6VXNlcjI0ODU0Njkz","avatar_url":"https://avatars2.githubusercontent.com/u/24854693?v=4","gravatar_id":"","url":"https://api.github.com/users/mcl12345","html_url":"https://github.com/mcl12345","followers_url":"https://api.github.com/users/mcl12345/followers","following_url":"https://api.github.com/users/mcl12345/following{/other_user}","gists_url":"https://api.github.com/users/mcl12345/gists{/gist_id}","starred_url":"https://api.github.com/users/mcl12345/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcl12345/subscriptions","organizations_url":"https://api.github.com/users/mcl12345/orgs","repos_url":"https://api.github.com/users/mcl12345/repos","events_url":"https://api.github.com/users/mcl12345/events{/privacy}","received_events_url":"https://api.github.com/users/mcl12345/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-08-14T07:41:13Z","updated_at":"2018-08-17T08:14:40Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have created accounts in Autotask, but How I can create a multi-site where different locations exist with the API ?\r\n\r\nI have created locations directly via Autotask website and I did that :\r\n\r\n     query = atws.Query('Location')\r\n     query.WHERE('id', query.Equals, \"0\")\r\n\r\n     print query.pretty_print()\r\n\r\n     locations = at.query(query)\r\n\r\n     # enumerate them\r\n     for location in locations:\r\n          print location\r\n\r\nBut I had that :\r\nTraceback (most recent call last):\r\n  File \"search_locations.py\", line 32, in <module>\r\n    for location in locations:\r\n  File \"/usr/local/lib/python2.7/dist-packages/atws/wrapper.py\", line 372, in _query\r\n    response.raise_or_return_entities()\r\n  File \"/usr/local/lib/python2.7/dist-packages/atws/wrapper.py\", line 137, in raise_or_return_entities\r\n    self._raise()\r\n  File \"/usr/local/lib/python2.7/dist-packages/atws/wrapper.py\", line 141, in _raise\r\n    raise AutotaskAPIException(self)\r\natws.wrapper.AutotaskAPIException: 'Autotask API has returned an error.\\n    Please process the response attribute in this exception to detirmine \\n    the extent of this failure.\\n    '[Value cannot be null.\r\nParameter name: type, '<queryxml><entity>Location</entity><query><field>id<expression op=\"Equals\">0</expression></field><condition operator=\"AND\" /></query></queryxml>']\r\n\r\n\r\nHow to do to search locations ?\r\n\r\nAnd how do I create location via API ? :\r\n\r\n    location = at.new('Location')\r\n    location.LocationName = 'Test account api python 1'\r\n    location.Phone = \"0185762128\"\r\n    location.Address1        = \"une adresse\"\r\n    location.BillToAddress1  = \"une adresse\"\r\n    location.City            = \"une ville\"\r\n    location.BillToCity      = \"une ville\"\r\n    location.PostalCode      = \"78510\"\r\n    location.BillToZipCode   = \"78510\"\r\n    location.create()\r\n\r\nmy code doesn't work \r\n\r\nThanks in advance,\r\n"},"comment":{"url":"https://api.github.com/repos/MattParr/python-atws/issues/comments/413792489","html_url":"https://github.com/MattParr/python-atws/issues/50#issuecomment-413792489","issue_url":"https://api.github.com/repos/MattParr/python-atws/issues/50","id":413792489,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzc5MjQ4OQ==","user":{"login":"MattParr","id":5296115,"node_id":"MDQ6VXNlcjUyOTYxMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/5296115?v=4","gravatar_id":"","url":"https://api.github.com/users/MattParr","html_url":"https://github.com/MattParr","followers_url":"https://api.github.com/users/MattParr/followers","following_url":"https://api.github.com/users/MattParr/following{/other_user}","gists_url":"https://api.github.com/users/MattParr/gists{/gist_id}","starred_url":"https://api.github.com/users/MattParr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattParr/subscriptions","organizations_url":"https://api.github.com/users/MattParr/orgs","repos_url":"https://api.github.com/users/MattParr/repos","events_url":"https://api.github.com/users/MattParr/events{/privacy}","received_events_url":"https://api.github.com/users/MattParr/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T08:14:40Z","updated_at":"2018-08-17T08:14:40Z","author_association":"OWNER","body":"Create the account.\nThen create the account physical locations.  They are both entities.\n\nWhen you create the account physical location you relate it to the account\nusing the AccountID field\n\nOn Thu, 16 Aug 2018, 14:28 mcl12345, <notifications@github.com> wrote:\n\n> Traceback (most recent call last):\n> File \"licca.py\", line 779, in action_bouton_import_compagnie\n> account.create() # this will create the company in Autotask\n> File \"/usr/local/lib/python3.5/dist-packages/atws/monkeypatch/crud.py\",\n> line 32, in mp_create\n> result = entity._wrapper.create(entity).fetch_one()\n> File \"/usr/local/lib/python3.5/dist-packages/atws/wrapper.py\", line 242,\n> in fetch_one\n> return next(self._generator,None)\n> File \"/usr/local/lib/python3.5/dist-packages/atws/wrapper.py\", line 318,\n> in process\n> for returned_entity in self._send_packet(action, packet, response):\n> File \"/usr/local/lib/python3.5/dist-packages/atws/wrapper.py\", line 408,\n> in _send_packet\n> raise AutotaskProcessException(e,response)\n> atws.wrapper.AutotaskProcessException: 'During send or receive with the\n> API, an error has \\n occurred. Please see the exception attribute for\n> details about the error.\\n Please see the response attribute as some API\n> commands may have sucessfully \\n completed before the exception occurred\\n\n> 'TypeNotFound(\"Type not found: 'AccountPhysicalLocation'\",)[]\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/MattParr/python-atws/issues/50#issuecomment-413545311>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AFDP831WzVodfgS9QI1DlRG17PGEnu0Iks5uRXOFgaJpZM4V78Ot>\n> .\n>\n"}}
{"actor":{"display_login":"MattParr"}}