Skip to content

Latest commit

 

History

History
724 lines (530 loc) · 25.1 KB

WebhooksApi.md

File metadata and controls

724 lines (530 loc) · 25.1 KB

swagger_client.WebhooksApi

All URIs are relative to https://localhost/api/v1

Method HTTP request Description
add_hook_for_org POST /orgs/{orgid}/hooks Add hook for organization
add_hook_for_project POST /orgs/{orgid}/projects/{projectid}/hooks Add hook for project
delete_hook_for_org DELETE /orgs/{orgid}/hooks/{id} Delete organization hook
delete_hook_for_project DELETE /orgs/{orgid}/projects/{projectid}/hooks/{id} Delete project hook
get_hook_for_org GET /orgs/{orgid}/hooks/{id} Get organization hook details
get_hook_for_project GET /orgs/{orgid}/projects/{projectid}/hooks/{id} Get project hook details
list_hooks_for_org GET /orgs/{orgid}/hooks List hooks for organization
list_hooks_for_project GET /orgs/{orgid}/projects/{projectid}/hooks List hooks for project
ping_hook_for_org POST /orgs/{orgid}/hooks/{id}/ping Ping an org hook
ping_hook_for_project POST /orgs/{orgid}/projects/{projectid}/hooks/{id}/ping Ping a project hook
update_hook_for_org PUT /orgs/{orgid}/hooks/{id} Update hook for organization
update_hook_for_project PUT /orgs/{orgid}/projects/{projectid}/hooks/{id} Update hook for project

add_hook_for_org

object add_hook_for_org(orgid, options=options)

Add hook for organization

Adds a new organization level hook. An organization level hook is triggered by events from all projects belonging to the organziation. NOTE: you must be a manager in the organization to add new hooks.

Hook Type Configuration Parameters

<div class="webhook-tag-desc">
TypeConfiguration Options
web
urlEndpoint to submit POST request
encodingEither json (default) or form
sslVerifyVerify SSL certificates of HTTPS endpoint
secretUsed to compute the SHA256 HMAC signature of the hook body and adds a X-UnityCloudBuild-Signature header to the payload
slack
urlSlack incoming webhook URL. Learn more at https://api.slack.com/incoming-webhooks

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
options = swagger_client.Options2() # Options2 |  (optional)

try:
    # Add hook for organization
    api_response = api_instance.add_hook_for_org(orgid, options=options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->add_hook_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
options Options2 [optional]

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

add_hook_for_project

object add_hook_for_project(orgid, projectid, options=options)

Add hook for project

Adds a new project level hook. A project level hook is only triggered by events from the specific project. NOTE: you must be a manager in the organization to add new hooks.

Hook Type Configuration Parameters

<div class="webhook-tag-desc">
TypeConfiguration Options
web
urlEndpoint to submit POST request
encodingEither json (default) or form
sslVerifyVerify SSL certificates of HTTPS endpoint
secretUsed to compute the SHA256 HMAC signature of the hook body and adds a X-UnityCloudBuild-Signature header to the payload
slack
urlSlack incoming webhook URL. Learn more at https://api.slack.com/incoming-webhooks

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier
options = swagger_client.Options4() # Options4 |  (optional)

try:
    # Add hook for project
    api_response = api_instance.add_hook_for_project(orgid, projectid, options=options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->add_hook_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier
options Options4 [optional]

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_hook_for_org

str delete_hook_for_org(orgid, id)

Delete organization hook

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
id = 'id_example' # str | Hook record identifier

try:
    # Delete organization hook
    api_response = api_instance.delete_hook_for_org(orgid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->delete_hook_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
id str Hook record identifier

Return type

str

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_hook_for_project

str delete_hook_for_project(orgid, projectid, id)

Delete project hook

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier
id = 'id_example' # str | Hook record identifier

try:
    # Delete project hook
    api_response = api_instance.delete_hook_for_project(orgid, projectid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->delete_hook_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier
id str Hook record identifier

Return type

str

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_hook_for_org

object get_hook_for_org(orgid, id)

Get organization hook details

Get details of a hook by id

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
id = 'id_example' # str | Hook record identifier

try:
    # Get organization hook details
    api_response = api_instance.get_hook_for_org(orgid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->get_hook_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
id str Hook record identifier

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_hook_for_project

object get_hook_for_project(orgid, projectid, id)

Get project hook details

Get details of a hook by id

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier
id = 'id_example' # str | Hook record identifier

try:
    # Get project hook details
    api_response = api_instance.get_hook_for_project(orgid, projectid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->get_hook_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier
id str Hook record identifier

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_hooks_for_org

list[InlineResponse2005] list_hooks_for_org(orgid)

List hooks for organization

List all hooks configured for the specified organization

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier

try:
    # List hooks for organization
    api_response = api_instance.list_hooks_for_org(orgid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->list_hooks_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier

Return type

list[InlineResponse2005]

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_hooks_for_project

list[InlineResponse2005] list_hooks_for_project(orgid, projectid)

List hooks for project

List all hooks configured for the specified project

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier

try:
    # List hooks for project
    api_response = api_instance.list_hooks_for_project(orgid, projectid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->list_hooks_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier

Return type

list[InlineResponse2005]

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ping_hook_for_org

str ping_hook_for_org(orgid, id)

Ping an org hook

Send a ping event to an org hook.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
id = 'id_example' # str | Hook record identifier

try:
    # Ping an org hook
    api_response = api_instance.ping_hook_for_org(orgid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->ping_hook_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
id str Hook record identifier

Return type

str

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ping_hook_for_project

str ping_hook_for_project(orgid, projectid, id)

Ping a project hook

Send a ping event to a project hook.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier
id = 'id_example' # str | Hook record identifier

try:
    # Ping a project hook
    api_response = api_instance.ping_hook_for_project(orgid, projectid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->ping_hook_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier
id str Hook record identifier

Return type

str

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_hook_for_org

object update_hook_for_org(orgid, id, options=options)

Update hook for organization

Update a new hook. NOTE: you must be a manager in the organization to update hooks.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
id = 'id_example' # str | Hook record identifier
options = swagger_client.Options3() # Options3 |  (optional)

try:
    # Update hook for organization
    api_response = api_instance.update_hook_for_org(orgid, id, options=options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->update_hook_for_org: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
id str Hook record identifier
options Options3 [optional]

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_hook_for_project

object update_hook_for_project(orgid, projectid, id, options=options)

Update hook for project

Update an existing hook. NOTE: you must be a manager of the project to update hooks.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: apikey
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.WebhooksApi(swagger_client.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier
id = 'id_example' # str | Hook record identifier
options = swagger_client.Options5() # Options5 |  (optional)

try:
    # Update hook for project
    api_response = api_instance.update_hook_for_project(orgid, projectid, id, options=options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WebhooksApi->update_hook_for_project: %s\n" % e)

Parameters

Name Type Description Notes
orgid str Organization identifier
projectid str Project identifier
id str Hook record identifier
options Options5 [optional]

Return type

object

Authorization

apikey, permissions

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain, text/html, text/csv

[Back to top] [Back to API list] [Back to Model list] [Back to README]