Node.js client for the Mashery REST API (v3).
Install the module with npm install mashery-client --save
var mashery = require('mashery');
// initialize the API client
var api = mashery.init({
user: '<user_id>',
pass: '<user_pass>',
key: '<api_key>',
secret: '<api_secret>',
areaUuid: '<area_uuid>'
});
// note authentication will be automatically handled for you
// list all services
apiClient.methods.fetchAllServices({}, function(serviceData, serviceRawResponse){
console.log(JSON.stringify(serviceData, null, 4));
});
// add an endpoint to an existing service
var args = {
path: { serviceId: '<service_id>' },
data: {<JSON_object_representing_endpoint>}
};
apiClient.methods.createServiceEndpoint(args, function(epData, epRawResponse){
console.log(JSON.stringify(epData, null, 4));
});
Method | Args |
---|---|
fetchAllServices | |
fetchService | id |
createService | |
updateService | id |
deleteService | id |
Method | Args |
---|---|
fetchAllServiceEndpoints | id |
fetchServiceEndpoint | serviceId, id |
createServiceEndpoint | serviceId |
updateServiceEndpoint | serviceId, id |
deleteServiceEndpoint | serviceId, id |
Method | Args |
---|---|
fetchAllEndpointMethods | serviceId, endpointId |
fetchEndpointMethod | serviceId, endpointId, id |
createEndpointMethod | serviceId, endpointId |
updateEndpointMethod | serviceId, endpointId, id |
deleteEndpointMethod | serviceId, endpointId, id |
Method | Args |
---|---|
fetchSecurityProfile | serviceId |
createSecurityProfile | |
updateSecurityProfile | serviceId |
deleteSecurityProfile | serviceId |
Service Error Set Documentation
Method | Args |
---|---|
fetchAllServiceErrorSets | id |
fetchServiceErrorSet | serviceId, id |
createServiceErrorSet | serviceId |
updateServiceErrorSet | serviceId, id |
deleteServiceErrorSet | serviceId, id |
Service Error Set Documentation
Method | Args |
---|---|
fetchAllErrorMessages | serviceId, errorSetId |
fetchErrorMessage | serviceId, errorSetId, id |
createErrorMessage | serviceId, errorSetId |
updateErrorMessage | serviceId, errorSetId, id |
deleteErrorMessage | serviceId, errorSetId, id |
Method | Args |
---|---|
fetchEndpointCache | serviceId, endpointId |
createEndpointCache | serviceId, endpointId |
updateEndpointCache | serviceId, endpointId |
deleteEndpointCache | serviceId, endpointId |
Security Profile Documentation
Method | Args |
---|---|
fetchSecurityProfile | serviceId |
createSecurityProfile | |
updateSecurityProfile | serviceId |
deleteSecurityProfile | serviceId |
Security Profile Documentation
Method | Args |
---|---|
fetchSecurityProfileOAuth | serviceId |
createSecurityProfileOAuth | |
updateSecurityProfileOAuth | serviceId |
deleteSecurityProfileOAuth | serviceId |
Method | Args |
---|---|
fetchAllResponseFilters | serviceId, endpointId, methodId |
fetchResponseFilter | serviceId, endpointId, methodId, id |
createResponseFilter | serviceId, endpointId, methodId |
updateResponseFilter | serviceId, endpointId, methodId, id |
deleteResponseFilter | serviceId, endpointId, methodId, id |
Scheduled Maintenance Documentation
Method | Args |
---|---|
fetchScheduledEvent | serviceId, endpointId |
createScheduledEvent | serviceId, endpointId |
updateScheduledEvent | serviceId, endpointId |
deleteScheduledEvent | serviceId, endpointId |
Method | Args |
---|---|
fetchCORS | serviceId, endpointId |
createCORS | serviceId, endpointId |
updateCORS | serviceId, endpointId |
deleteCORS | serviceId, endpointId |
Method | Args |
---|---|
fetchSysAuth | serviceId, endpointId |
createSysAuth | serviceId, endpointId |
updateSysAuth | serviceId, endpointId |
deleteSysAuth | serviceId, endpointId |
Method | Args |
---|---|
fetchAllServiceRoles | id |
fetchServiceRole | serviceId, id |
createServiceRole | serviceId |
updateServiceRole | serviceId, id |
deleteServiceRole | serviceId, id |
Method | Args |
---|---|
fetchAllPackages | |
fetchPackage | id |
createPackage | |
updatePackage | id |
deletePackage | id |
Method | Args |
---|---|
fetchAllPackageKeys | |
fetchPackageKey | id |
updatePackageKey | id |
deletePackageKey | id |
Method | Args |
---|---|
fetchAllPlans | packageId |
fetchPlan | packageId, id |
createPlan | packageId |
Method | Args |
---|---|
fetchAllPlanServices | packageId, planId |
fetchAllPlanServicesForService | packageId, planId, id |
createPlanService | packageId, planId |
createPlanEndpoint | packageId, planId, serviceId |
createPlanMethod | packageId, planId, serviceId, endpointId |
Method | Args | Documentation |
---|---|---|
fetchAllDomains | Domains | |
fetchDomain | ||
createDomain | ||
fetchPublicDomains | Public Domains | |
fetchPublicDomainFQDNs | FQDN | |
fetchSystemDomains | System Domain |
Method | Args |
---|---|
fetchAllRoles |
Scheduled Maintenance Documentation
Method | Args |
---|---|
fetchAllScheduledMaintenance | |
fetchScheduledMaintenance | id |
createScheduledMaintenance | |
updateScheduledMaintenance | id |
deleteScheduledMaintenance | id |
Scheduled Maintenance Endpoint Documentation
Method | Args |
---|---|
fetchAllScheduledMaintenanceEndpoints | maintenanceId |
fetchScheduledMaintenanceEndpoint | maintenanceId, id |
createScheduledMaintenanceEndpoint | maintenanceId |
updateScheduledMaintenanceEndpoint | maintenanceId, id |
deleteScheduledMaintenanceEndpoint | maintenanceId, id |
Email Template Set Documentation
Method | Args |
---|---|
fetchAllEmailTemplateSets | |
fetchEmailTemplateSet | id |
createEmailTemplateSet | |
updateEmailTemplateSet | id |
deleteEmailTemplateSet | id |
Method | Args |
---|---|
fetchAllEmailTemplates | emailSetId |
fetchEmailTemplate | emailSetId, id |
createEmailTemplate | emailSetId |
updateEmailTemplate | emailSetId, id |
deleteEmailTemplate | emailSetId, id |
Brian Antonelli
Copyright (c) 2016 Cox Automotive
Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the COPYING file.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.