Keys
After Creating a Key
This event trigger is fired when a applicationobject is created in the Mashery platform. Keys are created:
During the registration process (via the portal)
Via the Administrative Dashboard (Keys tab)
Via the Mashery API.
This event trigger event is executed after the actual key object is saved in the Mashery database.
Event Trigger Call Structure (Mashery to Customer-hosted Endpoint)
| HTTP Method | PUT |
| Path | /v1/key/<key id> |
| Parameters | event=post-create&txn=<transaction id will be provided at event trigger execution time> |
| Body | JSON, or application/x-www-form-urlencoded, representation of key object. This is determined by the setting found in the Integration tab of Portal Settings in the Mashery Console. |
Example Call:
PUT /v1/key/14398445?event=post-create&txn=46f6497a6b284411aa715427608e6df2 HTTP/1.1
Host: api.customer.com
Accept: application/json
Key-Agent: Mashery Event Trigger 1.0
Content-Type: application/json
{
"member": {
"region": "",
"external_id": "",
"phone": "",
"address1": "",
"address2": "",
"area_status": "active",
"registration_ipaddr": "",
"blog": "http://blog.mashery.com",
"im": "",
"country_code": "",
"uri": "http://www.mashery.com",
"object_type": "member",
"first_name": "Event Trigger",
"display_name": "event triggerTester",
"username": "event triggerTester",
"created": "2012-10-09T15:34:50Z",
"updated": "2012-10-09T17:54:40Z",
"email": "jpollock@mashery.com",
"postal_code": "",
"company": "Mashery",
"last_name": "Test",
"locality": "",
"imsvc": ""
},
"oauth_rate_limit_ceiling": 0,
"limits": [
{
"source": "service",
"ceiling": 2,
"period": "second"
},
{
"source": "service",
"ceiling": 5000,
"period": "day"
}
],
"oauth_qps_limit_exempt": false,
"application": {
"preferred_protocol": "",
"tags": "",
"external_id": "",
"status": "draft",
"ads_system": "",
"type": "",
"uri": "http://www.mashery.com",
"object_type": "application",
"id": 146082,
"username": "event triggerTester",
"preferred_output": "",
"how_did_you_hear": "",
"created": "2012-10-09T17:54:41Z",
"updated": "2012-10-09T17:58:21Z",
"description": "This is a great application",
"usage_model": "",
"name": "Test App for event triggerTester",
"ads": false,
"notes": "",
"commercial": false
},
"oauth_user_limits": [],
"status": "active",
"group_id": 0,
"oauth_qps_limit_ceiling": 0,
"qps_limit_ceiling": 0,
"qps_limit_exempt": false,
"apikey": "mkz884zzebkmufs3r2ebwspn",
"object_type": "key",
"username": "event triggerTester",
"protected_methods": false,
"oauth_rate_limit_exempt": false,
"service_key": "nrm4mmu843n2q2rd22fzj49c",
"created": "2012-10-09T17:58:43Z",
"updated": "2012-10-09T17:58:43Z",
"rate_limit_ceiling": 0,
"rate_limit_exempt": false,
"service": {
"service_key": "nrm4mmu843n2q2rd22fzj49c",
"updated": "2012-08-23T20:04:16Z",
"created": "2011-11-05T01:47:29Z",
"name": "Catalog API",
"limits": [
{
"source": "service",
"ceiling": 2,
"period": "second"
},
{
"source": "service",
"ceiling": 5000,
"period": "day"
}
],
},
"secret": "wMkKYJr",
"required_referer": ""
}
Expected Response Sent from Customer-hosted Endpoint
| Response Code | HTTP status code - any non-200 response will be considered failure; future capabilities will allow for re-try of this operation if error received. Response does not impact any database operations - the data is already saved in the database and that operation cannot be rolled back due to a non-200 response - nor does it result in end-user errors. |
| Content Type | application/json |
| Content | Member JSON string (valid JSON) |
After Updating a Key
This event trigger is fired when an updated, or modified, key object is saved in the Mashery platform. This event trigger event is executed after the actual key object is saved in the Mashery database.
Event Trigger Call Structure (Mashery to Customer-hosted Endpoint)
| HTTP Method | PUT |
| Path | /v1/key/<key id> |
| Parameters | event=post-update&txn=<transaction id will be provided at event trigger execution time> |
| Body | JSON, or application/x-www-form-urlencoded, representation of key object. This is determined by the setting found in the Integration tab of Portal Settings in the Mashery Console. |
Example Call:
PUT /v1/key/14398445?event=post-update&txn=8807190f73701b1bdf5a2272f445366f HTTP/1.1
Host: api.customer.com
Accept: application/json
Key-Agent: Mashery Event Trigger 1.0
Content-Type: application/json
{
"member": {
"region": "",
"external_id": "",
"phone": "",
"address1": "",
"address2": "",
"area_status": "active",
"registration_ipaddr": "",
"blog": "http://blog.mashery.com",
"im": "",
"country_code": "",
"uri": "http://www.mashery.com",
"object_type": "member",
"first_name": "Event Trigger",
"display_name": "event triggerTester",
"username": "event triggerTester",
"created": "2012-10-09T15:34:50Z",
"updated": "2012-10-09T17:54:40Z",
"email": "jpollock@mashery.com",
"postal_code": "",
"company": "Mashery",
"last_name": "Test",
"locality": "",
"imsvc": ""
},
"oauth_rate_limit_ceiling": 0,
"limits": [
{
"source": "service",
"ceiling": 2,
"period": "second"
},
{
"source": "service",
"ceiling": 500000,
"period": "day"
}
],
"oauth_qps_limit_exempt": false,
"application": {
"preferred_protocol": "",
"tags": "",
"external_id": "",
"status": "draft",
"ads_system": "",
"type": "",
"uri": "http://www.mashery.com",
"object_type": "application",
"id": 146082,
"username": "event triggerTester",
"preferred_output": "",
"how_did_you_hear": "",
"created": "2012-10-09T17:54:41Z",
"updated": "2012-10-09T17:58:21Z",
"description": "This is a great application",
"usage_model": "",
"name": "Test App for event triggerTester",
"ads": false,
"notes": "",
"commercial": false
},
"oauth_user_limits": [],
"status": "active",
"group_id": 0,
"oauth_qps_limit_ceiling": 0,
"qps_limit_ceiling": 0,
"qps_limit_exempt": false,
"apikey": "mkz884zzebkmufs3r2ebwspn",
"object_type": "key",
"username": "event triggerTester",
"protected_methods": false,
"oauth_rate_limit_exempt": false,
"service_key": "nrm4mmu843n2q2rd22fzj49c",
"created": "2012-10-09T17:58:43Z",
"updated": "2012-10-09T17:58:43Z",
"rate_limit_ceiling": 0,
"rate_limit_exempt": false,
"service": {
"service_key": "nrm4mmu843n2q2rd22fzj49c",
"updated": "2012-08-23T20:04:16Z",
"created": "2011-11-05T01:47:29Z",
"name": "Catalog API",
"limits": [
{
"source": "service",
"ceiling": 2,
"period": "second"
},
{
"source": "service",
"ceiling": 5000,
"period": "day"
}
],
},
"secret": "wMkKYJr",
"required_referer": ""
}
Expected Response Sent from Customer-hosted Endpoint
| Response Code | HTTP status code - any non-200 response will be considered failure; future capabilities will allow for re-try of this operation if error received. Response does not impact any database operations - the data is already saved in the database and that operation cannot be rolled back due to a non-200 response - nor does it result in end-user errors. |
| Content Type | application/json |
| Content | Member JSON string (valid JSON) |
After Deleting a Key
This event trigger is fired when a key object is created in the Mashery platform. Keys are created:
During the registration process (via the portal)
Via the Administrative Dashboard (Keys tab)
Via the Mashery API.
This event trigger event is executed after the actual key object is deleted in the Mashery database.
Event Trigger Call Structure (Mashery to Customer-hosted Endpoint)
| HTTP Method | DELETE |
| Path | /v1/key/<key id> |
| Parameters | event=post-delete&txn=<transaction id will be provided at event trigger execution time> |
Example Call:
DELETE /v1/key/14398445?event=post-delete&txn=07e108fd854ae11e66b5abdf7d83585f HTTP/1.1 Host: api.customer.com
Expected Response Sent from Customer-hosted Endpoint
| Response Code | HTTP status code - any non-200 response will be considered failure; future capabilities will allow for re-try of this operation if error received. Response does not impact any database operations - the data is already deleted from the database and that operation cannot be rolled back due to a non-200 response - nor does it result in end-user errors. |
Docs Navigation
- API Documentation Portal
- IO Docs Definition
- Mashery API Documentation
- Mashery 3.0 API Guide
- Mashery 2.0 API Guide
- OAuth Supporting Methods
- Examples
- JSON RPC
- Authentication
- API Objects
- Fetching Objects
- Query Language
- Creating Objects
- Updating Objects
- Validating Fields
- Deleting Objects
- Applications
- General Object Methods
- Members
- Packages
- Plans
- Package Keys
- Keys
- Developer Classes
- Services
- Roles
- Mashery 2.0 Reporting API Guide
- Event Trigger API
- Differences between Roles and Portal Access Groups
- Managing a Portal Access Group Using Mashery V2 or V3 API
- Mashery Reporting Event Post API Guide
- Tips and Tricks
- Your Portal
- API Traffic Manager
- I/O Docs WSDL requirements