This object manages authentication and authorizations during interaction between your system and ours. For the moment, it is possible to define the following authorizations on this object:
money-in-only
: Only API requests to bring money into your account can be made with this AuthAccess object.read-only
: Only read API requests can be made with this AuthAccess object. It will be possible for example to retrieve the transaction list programmatically and impossible to transfer money or to create another new AuthAccess object.read/money-in
: Only read API requests AND requests to bring money into your account can be made with this AuthAccess object.read-write/no-money-out
: Read or write API requests can be made but it won't be possible to transfer money out of your account. Note that it is also impossible to create an AuthAccess with this object that will allow transfer money out of your account. full-access
: All possibles API requests on your account can be done with this object create
Create a new AuthAccess
object and return the newly created object.
This operation takes the following parameters as input:
CreateAuthAccessForm
name
string
permission
string
description
string | undefined
foreignData
string | undefined
foreignId
string | undefined
Here's an example of code for creating a AuthAccess
object:
const authAccessPromise =
fPay.authAccess.create({
name: "API Keys for CRM developers",
permission: "ReadWriteNoMoneyOut",
description: "My description",
foreignData: "{\"myKey\": 19, \"myOtherKey\": \"myOtherValue\"}",
foreignId: "123456789"
});
get
Returns an object AuthAccess
found by an identifier
.
You can use a unique ID specific to your system. To use your own ID instead of the one generated by FPay, you need to specify the foreignId
field when creating the object. This will enable you to retrieve the object via the foreignId
field, which must be unique for all AuthAccess
objects. Here are all the fields whose values can be used as identifiers for this operation:
id
token
foreignId
const authAccessPromise = fPay.authAccess.get("identifier");
list
Returns a collection of AuthAccess
objects, possibly filtered and/or sorted. Here are the parameters supported by this operation.
NAME | TYPE | DESCRIPTION | DEFAULT VALUE |
---|---|---|---|
filter | string | undefined | Condition to be met by any object returned in this collection |
|
sortBy | string | undefined | Specify the field and the order (ascending or descending) by which returned objects will be sorted |
|
limit | number | undefined | Total number of results to return in this collection |
|
Here are a few examples of code to execute a listing to return a collection of AuthAccess
objects:
const authAccessCollectionPromise = fPay.authAccess.listAll();
const authAccessCollectionPromise =
fPay.authAccess.list({
sortBy: "id:ASC"
});
const authAccessCollectionPromise =
fPay.authAccess.list({
limit: 5
});
const authAccessCollectionPromise =
fPay.authAccess.list({
filter: "id in {'31234', '5678', '9990'}"
});
const authAccessCollectionPromise =
fPay.authAccess.list({
filter: "createdTime isBefore Yesterday",
sortBy: "foreignId:DESC"
});
const authAccessCollectionPromise =
fPay.authAccess.list({
filter: "id startsWith abcd",
sortBy: "createdTime:ASC",
limit: 25
});
fetchPage
When you fetch a list of AuthAccess
, the results returned by the server can be paginated, i.e. they will be arranged on several pages. This fetchPage
function allows you to navigate from page to page, iterating over all the elements. Consequently, this function returns a collection of AuthAccess
.
Let's say you've retrieved a collection of AuthAccess
with the following code:
const authAccessCollectionPromise = fPay.authAccess.listAll();
If the result is spread over several pages, to go to the next page, you should do:
authAccessCollectionPromise.then(authAccessCollection => {
if(authAccessCollection.hasNextPage()) {
const nextAuthAccessPromise = fPay.authAccess.fetchPage(authAccessCollection.pagination.nextPage);
}
});
update
Modify a AuthAccess
object and return the modified version.
Here are all the fields whose values can be used as identifiers for this operation:
id
token
foreignId
AuthAccess
objects:NAME | TYPE | DESCRIPTION |
---|---|---|
description | string | undefined | Can be updated Can be Deleted |
foreignData | string | undefined | Can be updated Can be Deleted |
Here are a few examples of code to execute an update:
authAccessPromise =
fPay.authAccess.update({
id: "<id | foreignId>",
change: {
description: "<new value>",
foreignData: "<new value>"
}
});
authAccessPromise =
fPay.authAccess.update({
id: "<id | foreignId>",
change: {
description: "<new value>"
},
'remove': ['foreignData']
});
authAccessPromise =
fPay.authAccess.update({
id: "<id | foreignId>",
'remove': ['description', 'foreignData']
});
When you retrieve a list, here are the fields you can use for filtering and sorting. as well as sorting.
NAME | TYPE | DESCRIPTION |
---|---|---|
createdTime | string | |
createdTime.iso8601 | string | |
createdTime.timestamp.milliseconds | number | |
createdTime.timestamp.seconds | number | |
creator | string | |
creator._type | string | |
creator.accountId | string | |
creator.authAccessId | string | |
creator.personId | string | |
description | string | |
foreignId | string | |
id | string | |
isEnabled | boolean | |
name | string | |
secretKey | string | |
token | string |
Code examples are available on the Audit & Dashboard page
AuthAccess
createdTime
UTCDateTime
iso8601
string
timestamp
Timestamp
milliseconds
number
seconds
Double
creator
Creator
Creator.Api
Api
_type
string
accountId
string
authAccessId
string
Creator.Ui
Ui
_type
string
accountId
string
personId
string
description
string | undefined
foreignData
string | undefined
foreignId
string | undefined
id
string
isEnabled
boolean
name
string
permission
AuthAccessPermission
AuthAccessPermission.Complex
Complex
_type
string
AuthAccessPermission.Simple
Simple
_type
string
name
string
secretKey
string
AuthAccess
object, the value of the field named secretKey
must be kept absolutely secret and used only on your servers. This implies that you should never use the value of this field as a variable or constant in the source code of a mobile application, a web application or in the source code of any application whose binary may be public and visible to all. There are many tools to access strings in the source code from a binary around here.token
string
url
string