Skip to content

Commit

Permalink
[EVOLUTION] expose instance settings in connector status
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanogueira committed Aug 20, 2024
1 parent 9d958f4 commit 2bfe6fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rocket_connect/plugins/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def initialize(self):

def status_session(self):
if self.config.get("endpoint", None):

output = {}
# GET {{baseUrl}}/instance/connectionState/{{instance}}
secret_key = self.config.get("secret_key")
Expand Down Expand Up @@ -148,9 +149,22 @@ def status_session(self):
endpoint_fetchinstances_response.json()
)

# fetch instance settings
endpoint_settings_url = "{}/settings/find/{}".format(
self.config.get("endpoint"),
instance_name,
)
endpoint_settings_response = requests.request(
"GET",
endpoint_settings_url,
headers=headers,
)

if status_instance_response:
output = status_instance_response.json()
output["webhook"] = endpoint_webhook_response.json()
if endpoint_settings_response:
output["settings"] = endpoint_settings_response.json()
if endpoint_fetchinstances_response:
output["instance"] = endpoint_fetchinstances_response
return output
Expand Down

0 comments on commit 2bfe6fd

Please sign in to comment.