@ziqni-tech/member-api-client
v1.0.27
Published
Client library for Ziqni Gamification API
Downloads
214
Keywords
Readme
ziqni_member_api
ZiqniMemberApi - JavaScript client for ziqni_member_api The ZIQNI Member-API is the primary resource used to build services and widgets for your members [customers, players, patients, etc]. The service is Stomp websokets with SOCK.js even though the system is decribed using OpenApi schema for convenience. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.16
- Package version: 1.0.16
- Build package: org.openapitools.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 ziqni_member_api --save
Finally, you need to build the module:
npm run build
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
To use the link you just defined in your project, switch to the directory you want to use your ziqni_member_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
Finally, you need to build the module:
npm run build
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):
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:
import { ApiClientStomp, AchievementsApiWs, AchievementRequest } from '@ziqni-tech/member-api-client';
const apiClientStomp = ApiClientStomp.instance;
await apiClientStomp.connect({ token: "YOUR ACCESS TOKEN" });
const achievementsApiWsClient = new AchievementsApiWs(apiClientStomp);
const achievementRequest = AchievementRequest.constructFromObject({
achievementFilter: {
productIds: [],
tags: [],
startDate: null,
endDate: null,
ids: [],
statusCode: {
moreThan: 0,
lessThan: 40
},
sortBy: [{
queryField: 'created',
order: 'Desc'
}],
skip: 0,
limit: 10,
constraints: []
}
}, null);
achievementsApiWsClient.getAchievements(achievementRequest, (json) => {
console.log('API called successfully. Returned data: ' + json.data);
});
Documentation for API Endpoints
All URIs are relative to https://member-api.ziqni.com
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- ZiqniMemberApi.AchievementsApi | getAchievements | POST /achievements | Get achievements by member reference id ZiqniMemberApi.AwardsApi | claimAwards | POST /awards-claim | Claim awards. ZiqniMemberApi.AwardsApi | declineAwards | POST /awards-decline | Claim awards. ZiqniMemberApi.AwardsApi | getAwards | POST /awards | Get awards. ZiqniMemberApi.CallbacksApi | listCallbacks | GET /callbacks | Describe the system callbacks and there constraints ZiqniMemberApi.CompetitionsApi | getCompetitions | POST /competitions | Get competitions by member reference id ZiqniMemberApi.ContestsApi | getContests | POST /contests | Get contests by member reference Id ZiqniMemberApi.FilesApi | getFiles | POST /files | Get files. ZiqniMemberApi.GraphsApi | getGraph | POST /graphs | Get achievements by member reference id ZiqniMemberApi.HeartbeatApi | heartbeat | POST /heartbeat | ZiqniMemberApi.InstantWinsApi | listInstantWins | POST /instant-wins | ZiqniMemberApi.InstantWinsApi | playInstantWin | POST /instant-wins-play | ZiqniMemberApi.LeaderboardApi | subscribeToLeaderboard | POST /leaderboard | ZiqniMemberApi.MembersApi | getMember | POST /member-info | Get member information by member reference id ZiqniMemberApi.MessagesApi | getMessages | POST /messages | Get messages by member reference id ZiqniMemberApi.MissionsApi | getMissionStates | POST /mission-states | ZiqniMemberApi.OptInApi | manageOptin | POST /manage-optin | Get member optin information ZiqniMemberApi.OptInApi | optInStates | POST /optin-states | Get member optin status information ZiqniMemberApi.ProductsApi | getProducts | POST /products | Get recommended products by product Id ZiqniMemberApi.RewardsApi | getRewards | POST /rewards | Get rewards ZiqniMemberApi.RulesApi | getRules | POST /rules | Get rules ZiqniMemberApi.StatsApi | getActiveEntitiesCount | POST /actives-by-entity | Get competitions and/or achievements count by product id or reference id
Documentation for Models
- ZiqniMemberApi.Achievement
- ZiqniMemberApi.AchievementAllOf
- ZiqniMemberApi.AchievementFilter
- ZiqniMemberApi.AchievementRequest
- ZiqniMemberApi.AchievementResponse
- ZiqniMemberApi.AchievementStrategies
- ZiqniMemberApi.ActionTypeAdjustmentFactor
- ZiqniMemberApi.Award
- ZiqniMemberApi.AwardAllOf
- ZiqniMemberApi.AwardFilter
- ZiqniMemberApi.AwardRequest
- ZiqniMemberApi.AwardResponse
- ZiqniMemberApi.AwardStatus
- ZiqniMemberApi.CallbackEntry
- ZiqniMemberApi.CallbacksResponse
- ZiqniMemberApi.ClaimAwardRequest
- ZiqniMemberApi.Competition
- ZiqniMemberApi.CompetitionAllOf
- ZiqniMemberApi.CompetitionCountResponse
- ZiqniMemberApi.CompetitionFilter
- ZiqniMemberApi.CompetitionRequest
- ZiqniMemberApi.CompetitionResponse
- ZiqniMemberApi.CompetitionStatus
- ZiqniMemberApi.CompetitionType
- ZiqniMemberApi.ConditionalOperator
- ZiqniMemberApi.Contest
- ZiqniMemberApi.ContestAllOf
- ZiqniMemberApi.ContestFilter
- ZiqniMemberApi.ContestReduced
- ZiqniMemberApi.ContestRequest
- ZiqniMemberApi.ContestResponse
- ZiqniMemberApi.ContestStatus
- ZiqniMemberApi.CustomFields
- ZiqniMemberApi.DateRange
- ZiqniMemberApi.DeclineAwardRequest
- ZiqniMemberApi.Dependancy
- ZiqniMemberApi.DependantOn
- ZiqniMemberApi.EntityChanged
- ZiqniMemberApi.EntityFilter
- ZiqniMemberApi.EntityGraph
- ZiqniMemberApi.EntityGraphEdge
- ZiqniMemberApi.EntityGraphEdgeType
- ZiqniMemberApi.EntityGraphNode
- ZiqniMemberApi.EntityGraphRequest
- ZiqniMemberApi.EntityGraphResponse
- ZiqniMemberApi.EntityGraphResult
- ZiqniMemberApi.EntityGraphTraversal
- ZiqniMemberApi.EntityRequest
- ZiqniMemberApi.EntityStateChanged
- ZiqniMemberApi.EntityType
- ZiqniMemberApi.Error
- ZiqniMemberApi.EventRefType
- ZiqniMemberApi.FieldType
- ZiqniMemberApi.File
- ZiqniMemberApi.FileObject
- ZiqniMemberApi.FileObjectAllOf
- ZiqniMemberApi.FileObjectResponse
- ZiqniMemberApi.FileRequest
- ZiqniMemberApi.FileResponse
- ZiqniMemberApi.GridLocation
- ZiqniMemberApi.InstantWin
- ZiqniMemberApi.InstantWinAllOf
- ZiqniMemberApi.InstantWinFilter
- ZiqniMemberApi.InstantWinPlayOutcome
- ZiqniMemberApi.InstantWinPlayRequest
- ZiqniMemberApi.InstantWinPlayResponse
- ZiqniMemberApi.InstantWinRequest
- ZiqniMemberApi.InstantWinResponse
- ZiqniMemberApi.InstantWinResult
- ZiqniMemberApi.InstantWinResultAllOf
- ZiqniMemberApi.InstantWinTile
- ZiqniMemberApi.Leaderboard
- ZiqniMemberApi.LeaderboardEntry
- ZiqniMemberApi.LeaderboardFilter
- ZiqniMemberApi.LeaderboardMember
- ZiqniMemberApi.LeaderboardResponse
- ZiqniMemberApi.LeaderboardSubscriptionRequest
- ZiqniMemberApi.ManageOptinRequest
- ZiqniMemberApi.Member
- ZiqniMemberApi.MemberAllOf
- ZiqniMemberApi.MemberRequest
- ZiqniMemberApi.MemberResponse
- ZiqniMemberApi.MemberType
- ZiqniMemberApi.Message
- ZiqniMemberApi.MessageAllOf
- ZiqniMemberApi.MessageFilter
- ZiqniMemberApi.MessageRequest
- ZiqniMemberApi.MessageResponse
- ZiqniMemberApi.MessageStatus
- ZiqniMemberApi.MessageType
- ZiqniMemberApi.MetaBasic
- ZiqniMemberApi.MetaInfo
- ZiqniMemberApi.MissionState
- ZiqniMemberApi.MissionStates
- ZiqniMemberApi.MissionStatesFilter
- ZiqniMemberApi.MissionStatesRequest
- ZiqniMemberApi.MissionStatesResponse
- ZiqniMemberApi.ModelCountRequest
- ZiqniMemberApi.ModelCountResponse
- ZiqniMemberApi.ModelDefault
- ZiqniMemberApi.NumberRange
- ZiqniMemberApi.OptInResponse
- ZiqniMemberApi.OptInStatesRequest
- ZiqniMemberApi.OptinAction
- ZiqniMemberApi.OptinStatesFilter
- ZiqniMemberApi.OptinStatus
- ZiqniMemberApi.OptionalModelFields
- ZiqniMemberApi.PointsStrategy
- ZiqniMemberApi.Product
- ZiqniMemberApi.ProductAllOf
- ZiqniMemberApi.ProductFilter
- ZiqniMemberApi.ProductReduced
- ZiqniMemberApi.ProductReducedAllOf
- ZiqniMemberApi.ProductRequest
- ZiqniMemberApi.ProductResponse
- ZiqniMemberApi.ProxyMessage
- ZiqniMemberApi.QueryMultipleFields
- ZiqniMemberApi.QuerySortBy
- ZiqniMemberApi.RangeQuery
- ZiqniMemberApi.RankingStrategy
- ZiqniMemberApi.ResponseMeta
- ZiqniMemberApi.Reward
- ZiqniMemberApi.RewardAllOf
- ZiqniMemberApi.RewardReduced
- ZiqniMemberApi.RewardReducedAllOf
- ZiqniMemberApi.RewardRequest
- ZiqniMemberApi.RewardResponse
- ZiqniMemberApi.RewardTypeReduced
- ZiqniMemberApi.RoundType
- ZiqniMemberApi.Rule
- ZiqniMemberApi.RuleArgument
- ZiqniMemberApi.RuleExpression
- ZiqniMemberApi.RuleRequest
- ZiqniMemberApi.RuleResponse
- ZiqniMemberApi.RuleRoutine
- ZiqniMemberApi.ScheduleType
- ZiqniMemberApi.Scheduling
- ZiqniMemberApi.ScoringStrategy
- ZiqniMemberApi.SortOrder
- ZiqniMemberApi.Strategy
- ZiqniMemberApi.StrategyType
- ZiqniMemberApi.TagFilter
- ZiqniMemberApi.UnsubscribeRequest
Documentation for Authorization
OAuth2
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://iam.ziqni.io/oauth/authorize
- Scopes:
- ViewContests: Grants read access
- ViewCompetitions: Grants read access
- ViewAchievements: Grants read access
- ViewRewards: Grants read access
- ViewMessages: Grants read access
- ViewAwards: Grants read access
- ViewRules: Grants read access
- ViewMembers: Grants read access