1.0.20 • Published 26 days ago

@ziqni-tech/member-api-client v1.0.20

Weekly downloads
-
License
Ziqni Commercial ...
Repository
github
Last release
26 days ago

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.14
  • Package version: 1.0.14
  • 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

ClassMethodHTTP requestDescription
ZiqniMemberApi.AchievementsApigetAchievementsPOST /achievementsGet achievements by member reference id
ZiqniMemberApi.AwardsApiclaimAwardsPOST /awards-claimClaim awards.
ZiqniMemberApi.AwardsApigetAwardsPOST /awardsGet awards.
ZiqniMemberApi.CallbacksApilistCallbacksGET /callbacksDescribe the system callbacks and there constraints
ZiqniMemberApi.CompetitionsApigetCompetitionsPOST /competitionsGet competitions by member reference id
ZiqniMemberApi.ContestsApigetContestsPOST /contestsGet contests by member reference Id
ZiqniMemberApi.FilesApigetFilesPOST /filesGet files.
ZiqniMemberApi.GraphsApigetGraphPOST /graphsGet achievements by member reference id
ZiqniMemberApi.HeartbeatApiheartbeatPOST /heartbeat
ZiqniMemberApi.InstantWinsApilistInstantWinsPOST /instant-wins
ZiqniMemberApi.InstantWinsApiplayInstantWinPOST /instant-wins-play
ZiqniMemberApi.LeaderboardApisubscribeToLeaderboardPOST /leaderboard
ZiqniMemberApi.MembersApigetMemberPOST /member-infoGet member information by member reference id
ZiqniMemberApi.MessagesApigetMessagesPOST /messagesGet messages by member reference id
ZiqniMemberApi.MissionsApigetMissionStatesPOST /mission-states
ZiqniMemberApi.OptInApimanageOptinPOST /manage-optinGet member optin information
ZiqniMemberApi.OptInApioptInStatesPOST /optin-statesGet member optin status information
ZiqniMemberApi.ProductsApigetProductsPOST /productsGet recommended products by product Id
ZiqniMemberApi.RewardsApigetRewardsPOST /rewardsGet rewards
ZiqniMemberApi.RulesApigetRulesPOST /rulesGet rules
ZiqniMemberApi.StatsApigetActiveEntitiesCountPOST /actives-by-entityGet competitions and/or achievements count by product id or reference id

Documentation for Models

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
1.0.20

26 days ago

1.0.19

1 month ago

1.0.18

3 months ago

1.0.17

5 months ago

1.0.16

8 months ago

1.0.15

9 months ago

1.0.14

10 months ago

1.0.13

12 months ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago