Skip to content

Commit

Permalink
Merge pull request #9 from zaphiro-technologies/get-token-connector
Browse files Browse the repository at this point in the history
Get token from connector
  • Loading branch information
arslanbekov authored Apr 24, 2024
2 parents b5985f3 + c26f4ee commit 8fdba4f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cloudconnexa/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ func (c *ConnectorsService) GetProfile(id string) (string, error) {
return string(body), nil
}

func (c *ConnectorsService) GetToken(id string) (string, error) {
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/api/beta/connectors/%s/profile/encrypt", c.client.BaseURL, id), nil)
if err != nil {
return "", err
}

body, err := c.client.DoRequest(req)
if err != nil {
return "", err
}
return string(body), nil
}

func (c *ConnectorsService) Create(connector Connector, networkItemId string) (*Connector, error) {
connectorJson, err := json.Marshal(connector)
if err != nil {
Expand Down

0 comments on commit 8fdba4f

Please sign in to comment.