Consents
API operation of consents.
1
2
3
4
5
6
7
8
9
10
{
"msisdn" : "+123456789" ,
"application" : "alphabet-xxxxx" ,
"client" : "youtube" ,
"scopes" : [
"FraudPreventionAndDetection:SimSwap" ,
"FraudPreventionAndDetection:NumberVerification" ,
"FraudPreventionAndDetection:SIMCardChange"
]
}
Name
Type
Required
Description
msisdn
string
false
A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with ‘+’.
application
string
false
Aggregator and Application Owner combination under which the application making the request is located.
client
string
false
Application that makes the request to consume the capacity.
scopes
[string]
false
capabilities to be consumed
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl -X POST https://opengateway.masstack.com/v1/orgs/{ org_id} /consents/validate \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-raw "{
'msisdn': '+123456789',
'application': 'alphabet-xxxxx',
'client': 'youtube',
'scopes': [
'FraudPreventionAndDetection:SimSwap',
'FraudPreventionAndDetection:NumberVerification',
'FraudPreventionAndDetection:SIMCardChange'
]
}"
200 - JsonObject
Custom schema example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"consents" : [
{
"id" : "SimSwap_FraudPreventionAndDetection_Agregador1App1" ,
"scope" : "FraudPreventionAndDetection:SimSwap" ,
"status" : "ACCEPTED"
},
{
"id" : "NumberVerification_FraudPreventionAndDetection_Agregador2App2" ,
"scope" : "FraudPreventionAndDetection:NumberVerification" ,
"status" : "PENDING"
}
]
}
Custom schema example
1
2
3
4
5
{
"status" : 400 ,
"code" : "INVALID_ARGUMENT" ,
"message" : "Client specified an invalid argument, request body or query param"
}
Name
Type
Required
Description
status
integer
true
HTTP response status code
code
string
true
Code given to this error
message
string
true
Detailed error description
Custom schema example
1
2
3
4
5
{
"status" : 401 ,
"code" : "UNAUTHENTICATED" ,
"message" : "Request not authenticated due to missing, invalid, or expired credentials."
}
Name
Type
Required
Description
status
integer
true
HTTP response status code
code
string
true
Code given to this error
message
string
true
Detailed error description
Custom schema example
1
2
3
4
5
{
"status" : 401 ,
"code" : "AUTHENTICATION_REQUIRED" ,
"message" : "New authentication is required."
}
Name
Type
Required
Description
status
integer
true
HTTP response status code
code
string
true
Code given to this error
message
string
true
Detailed error description
Custom schema example
1
2
3
4
5
{
"status" : 403 ,
"code" : "PERMISSION_DENIED" ,
"message" : "Client does not have sufficient permissions to perform this action."
}
Name
Type
Required
Description
status
integer
true
HTTP response status code
code
string
true
Code given to this error
message
string
true
Detailed error description
Parameters
Name
In
Type
Required
Description
org_id
path
string
true
‘none’
body
body
ConsentsCreateRequest
true
‘none’
1
2
3
4
5
6
{
"application" : "alphabet-xxxxx" ,
"client" : "youtube" ,
"scope" : "SimSwap" ,
"purpose" : "FraudPreventionAndDetection"
}
Name
Type
Required
Description
application
string
false
Aggregator and Application Owner combination under which the application making the request is located.
client
string
false
Application that makes the request to consume the capacity.
scope
string
false
capabilities to be consumed
purpose
string
false
purpose for which the capability is to be consumed
Request example
1
2
3
4
5
6
7
8
9
10
11
curl -X POST https://opengateway.masstack.com/v1/orgs/{ org_id} /consents/create \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-raw "{
'application': 'alphabet-xxxxx',
'client': 'youtube',
'scope': 'SimSwap',
'purpose': 'FraudPreventionAndDetection'
}"