Skip to content

Latest commit

History

119 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

powerlink-api

This package provides an easy to use API which lets you connect your custom Backend/Frontend apps to your Powerlink data.


Initialization & Authentication

Backend: const api = new plapi(TOKEN_ID);
Frontend - Development: const api = new plapi(TOKEN_ID);
Frontend - Production: const api = new plapi();
(The Powerlink App's cookie is used instead of a token in a production environment).

Create

import{plapi}from'powerlink-api';constapi=newplapi();api.create(objectType,{[fieldName]: value, ... });

Update

import{plapi}from'powerlink-api';constapi=newplapi();api.update(objectType,objectId,{[fieldName]: value, ... });

Delete

import{plapi}from"powerlink-api";constapi=newplapi();api.delete(objectType,objectId);

Views

import{plapi}from"powerlink-api";constapi=newplapi();api.getViews(objectType);

ViewRecords

import{plapi}from"powerlink-api";constapi=newplapi();api.getViewRecords(objectType,viewId,config);

Config

PropertyDescriptionExample
fieldsAdditional fields[ { name: string, logicalName: string, fieldObjectType: number, label: string, type: string }, ... ]
pageNumberPage numberStarts at: 1
sortBySort byaccountname/idnumber/telephone1

Query

import{plapi}from"powerlink-api";constapi=newplapi();api.query({objectType: 1,pageSize: 50,pageNumber: 1,fields: "accountname, idnumber, telephone1",query: "(idnumber = 12345678) AND (telephone1 = 036339060)",sortBy: "accountname",sortType: "desc",});
PropertyDescriptionExample
objectTypeObject typeAccount = 1, Contact = 2, Cases = 5 (See more..)
pageSizeResult per pageMin: 1 Max: 500
pageNumberPage numberStarts at: 1
fieldsRecord's fieldsAll fields = "*"
queryQuery conditions((idnumber = 1234) AND (idnumber = 5678))
sortBySort byaccountname/idnumber/telephone1
sortTypeSort typedesc/asc

Query property:

OperatorDescriptionExample
=Equalquery: "(idnumber = 1234)"
!=Not Equalquery: "(idnumber != 1234)"
>Greater thanquery: "(age1 > age2)"
<Less thanquery: "(age1 < age2)"
<=Greater than or equal toquery: "(age1 <= age2)"
>=Less than or equal toquery: "(age1 >= age2)"
ORLogical ORquery: "((idnumber = 1234) OR (idnumber = 456789))"
ANDLogical Andquery: "((idnumber = 1234) AND (accountname = 'משה'))"
is-nullNULL valuesquery: "(idnumber is-null 1234567)"
is-not-nullNot NULL valuesquery: "(idnumber is-not-null 1234567)"
start-withStarts withquery: "(idnumber start-with 1234567)"
end-withEnds withquery: "(idnumber end-with 1234567)"
not-start-withDoesn't start withquery: "(idnumber not-start-with 1234567)"
not-end-withDoesn't end withquery: "(idnumber not-end-with 1234567)"

You can combine both the AND and OR conditions using parenthesis.

Note

  • AND & OR conditions allow you to test multiple conditions (order of operations applies).

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages