smcp_cs_api
v0.1.7
Published
SMCP_customer_service_backend
Downloads
3
Readme
smcp_cs_api
SmcpCsApi - JavaScript client for smcp_cs_api SMCP customer service backend This SDK is automatically generated by the Swagger Codegen project:
- API version: 0.1.7
- Package version: 0.1.7
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install smcp_cs_api --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your smcp_cs_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('smcp_cs_api')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var SmcpCsApi = require('smcp_cs_api');
var api = new SmcpCsApi.BrandsApi()
var createBrandDto = new SmcpCsApi.CreateBrandDto(); // {CreateBrandDto}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.create(createBrandDto, callback);
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- SmcpCsApi.BrandsApi | create | POST /brands | Brands.create SmcpCsApi.BrandsApi | find | GET /brands | Brands.find SmcpCsApi.BrandsApi | update | PUT /brands/{brandId} | Brands.update SmcpCsApi.CitiesApi | find | GET /brand/{brandId}/cities | Cities.find SmcpCsApi.CustomersApi | findBySalesperson | GET /salespeople/{salespersonId}/customers | Customers.findBySalesperson SmcpCsApi.CustomersApi | getMine | GET /salespeople/me/customers | Customers.getMine SmcpCsApi.CustomersApi | reassignMineToAnotherShop | POST /salespeople/me/customers/{customerId}/re-assign-to-shop/{shopId} | Customers.reassignMineToAnotherShop SmcpCsApi.CustomersApi | searchMine | GET /salespeople/me/customers/search-by-name | Customers.searchMine SmcpCsApi.CustomersApi | searchRelevantToMeByMessage | GET /salespeople/me/customers/search-by-message | Customers.searchRelevantToMeByMessage SmcpCsApi.CustomersApi | searchRelevantToSalespersonByMessage | GET /salespeople/{salespersonId}/customers/search-by-message | Customers.searchRelevantToSalespersonByMessage SmcpCsApi.CustomersApi | searchUnderSalesperson | GET /salespeople/{salespersonId}/customers/search-by-name | Customers.searchUnderSalesperson SmcpCsApi.MessagesApi | findByBrandSession | GET /brands/{brandId}/sessions/{sessionId}/messages | Message.findByBrandSession SmcpCsApi.MessagesApi | sendToBrandSession | POST /brands/{brandId}/sessions/{sessionId}/messages | Message.sendToBrandSession SmcpCsApi.SalespeopleApi | createOrUpdate | POST /brands/{brandId}/shops/{shopId}/salespeople/create-or-update | Salespeople.createOrUpdate SmcpCsApi.SalespeopleApi | depriveManager | POST /brands/{brandId}/shops/{shopId}/salespeople/{salespersonId}/deprive-manager | Salespeople.depriveManager SmcpCsApi.SalespeopleApi | find | GET /brands/{brandId}/shops/{shopId}/salespeople | Salespeople.find SmcpCsApi.SalespeopleApi | findById | GET /brands/{brandId}/shops/{shopId}/salespeople/{salespersonId} | Salespeople.findById SmcpCsApi.SalespeopleApi | getMyBrand | GET /salespeople/me/brand | Salespeople.getMyBrand SmcpCsApi.SalespeopleApi | grantManager | POST /brands/{brandId}/shops/{shopId}/salespeople/{salespersonId}/grant-manager | Salespeople.grantManager SmcpCsApi.SalespeopleApi | lock | POST /brands/{brandId}/shops/{shopId}/salespeople/{salespersonId}/lock | Salespeople.lock SmcpCsApi.SalespeopleApi | me | GET /salespeople/me | Salespeople.me SmcpCsApi.SalespeopleApi | updateMyInfo | PUT /salespeople/me | Salespeople.updateMyInfo SmcpCsApi.SessionsApi | close | POST /sessions/{sessionId}/close | Sessions.close SmcpCsApi.SessionsApi | closeBySalesperson | POST /sessions/{sessionId}/close-by-salesperson | Sessions.closeBySalesperson SmcpCsApi.SessionsApi | find | GET /brands/{brandId}/sessions | Sessions.find SmcpCsApi.SessionsApi | findMineDetailed | GET /salespeople/me/sessions/all-in-one-detailed | Sessions.findMineDetailed SmcpCsApi.SessionsApi | findMineToBeTransferred | GET /salespeople/me/sessions/to-be-transferred | Sessions.findMineToBeTransferred SmcpCsApi.SessionsApi | findToBeTransferredOfSalesperson | GET /salespeople/{salespersonId}/sessions/to-be-transferred | Sessions.findToBeTransferredOfSalesperson SmcpCsApi.SessionsApi | sessionsFindDetailedOfSalesperson | GET /salespeople/{salespersonId}/sessions/all-in-one-detailed | Salesperson SmcpCsApi.SessionsApi | start | POST /sessions/start | Sessions.start SmcpCsApi.SessionsApi | startBySalesperson | POST /sessions/start-by-salesperson | Sessions.startBySalesperson SmcpCsApi.SessionsApi | transferMine | POST /salespeople/me/sessions/{sessionId}/transfer-to/{salespersonId} | Sessions.transferMine SmcpCsApi.ShopsApi | find | GET /brands/{brandId}/shops | Shops.find SmcpCsApi.ShopsApi | findById | GET /brands/{brandId}/shops/{shopId} | Shops.findById SmcpCsApi.ShopsApi | syncFromWcn2 | POST /brands/{brandId}/shops/sync-from-wcn2 | Shops.syncFromWcn2 SmcpCsApi.ShopsApi | update | PUT /brands/{brandId}/shops/{shopId} | Shops.update SmcpCsApi.SystemApi | envGet | GET /env | SmcpCsApi.SystemApi | getApiDocument | GET /api-doc.json | System.getApiDocument SmcpCsApi.SystemApi | uploadFile | POST /upload | System.uploadFile SmcpCsApi.WechatOfficialAccountsApi | notify | POST /wechat-official-accounts/{appId}/notify | WechatOfficialAccounts.notify SmcpCsApi.WorkWechatAppsApi | getSignature | GET /work-wechat-apps/signature | WorkWechatApps.getSignature SmcpCsApi.WorkWechatAppsApi | jumpBridge | GET /work-wechat-apps/{agentId}/bridge | WorkWechatApps.jumpBridge
Documentation for Models
- SmcpCsApi.AddSalespersonDto
- SmcpCsApi.CreateBrandDto
- SmcpCsApi.SendMessageDto
- SmcpCsApi.SessionDto
- SmcpCsApi.ShopDto
- SmcpCsApi.StartSessionDto
- SmcpCsApi.UpdateBrandDto
- SmcpCsApi.UpdateSalespersonDto
- SmcpCsApi.UpdateShopDto
Documentation for Authorization
bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header