Consent Requests
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
consentRequest.Allowed values:consentRequest
- Name
- id
- Type
- string
- Description
Unique identifier for the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
- Name
- createdAt
- Type
- string
- Description
The timestamp at which the consent request was created.
Example:"2024-01-09T15:00:51Z"
- Name
- deliveryMethod
- Type
- nullable string
- Description
The method by which the consent request is delivered to the user.
Example:"emailLink"Allowed values:emailLinksmssmsLinksmsOTP
- Name
- expiredAt
- Type
- nullable string
- Description
The timestamp at which the consent request expired.
Example:"2024-01-09T15:00:51Z"
- Name
- operation
- Type
- string
- Description
The operation being requested.
Example:"exchange.sim"Allowed values:change.phoneNumberchange.providerexchange.simissue.portOutCredentialsportin.subscription
- Name
- status
- Type
- string
- Description
The status of the consent request.
Example:"pending"Allowed values:approvedbypassedcanceledexpiredpending
- Name
- subject
- Type
- string
- Description
The ID of resource being affected by the operation. It can be for example a port out ID, if the operation is
issue.portOutCredentials.Example:"pto_0SNlurA049MEWV4DWEaT4SaeDI8s"
- Name
- subscription
- Type
- string
- Description
Unique identifier for the subscription inferred from the resource associated with this consent request, e.g. a port-out, porting, or subscription change.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
ConsentRequest object
{
"object": "consentRequest",
"id": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU",
"createdAt": "2024-01-09T15:01:51.0Z",
"deliveryMethod": "emailLink",
"expiredAt": "2024-01-09T15:00:51Z",
"operation": "exchange.sim",
"status": "pending",
"subject": "pto_0SNlurA049MEWV4DWEaT4SaeDI8s",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
List all consent requests
Returns a list of consent requests. The consent requests returned are sorted by creation date, with the most recently created consent requests appearing first.
Path Parameters
Query Parameters
- Name
- subject
- Type
- string
- Description
The unique identifier for the subject related to the consent request.
Example:"pto_0SNlurA049MEWV4DWEaT4SaeDI8s"
- Name
- subscription
- Type
- string
- Description
The unique identifier for the subscription related to the consent request.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
- Name
- status
- Type
- array
- Description
A comma-separated list of statuses to filter the consent requests by.
- Name
- after
- Type
- string
- Description
A cursor for use in pagination. The
afterparameter takes an object ID that defines the position in the list, only items immediately following the item with that ID will be returned.
- Name
- before
- Type
- string
- Description
A cursor for use in pagination. The
beforeparameter takes an object ID that defines the position in the list, only items immediately preceding the item with that ID will be returned.
- Name
- limit
- Type
- integer
- Description
The limit of items to be returned in the list, between 0 and 200.
Example:20Default:10>= 0<= 200
Responses
Returns a list of consentRequest objects.
- Name
- object
- Type
- string
- Description
Type of object is always
list.Allowed values:list
- Name
- items
- Type
- array
- Description
- List of objects of type
consentRequest.
- Name
- moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
afterpagination parameter if more items are available sorted after the current batch of items.
- Name
- moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
beforepagination parameter if more items are available sorted before the current batch of items.
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/consentRequests \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses 200
{
"object": "list",
"items": [
{
"object": "consentRequest",
"id": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU",
"createdAt": "2024-01-09T15:00:51Z",
"deliveryMethod": "emailLink",
"expiredAt": "2024-01-09T15:00:51Z",
"operation": "exchange.sim",
"status": "pending",
"subject": "pto_0SNlurA049MEWV4DWEaT4SaeDI8s",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Create a consent request
Creates a new consent request from an existing one, delivering a new code to the user. The existing consent request must be pending or expired and must be the most recent one for its resource. A pending one expires as soon as the new one is created.
Body
- Name
- fromConsentRequest
- Type
- string
- Description
The unique identifier for the existing consent request to recreate, e.g. when the user missed the original code. The new consent request covers the same operation and resource and carries a newly generated code. The referenced consent request must be
pendingorexpiredand must be the most recent one for its resource. Apendingone expires as soon as the new one is created.Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
required
Path Parameters
Responses
Returns the created consent request.
- Name
- object
- Type
- string
- Description
Type of object is always
consentRequest.Allowed values:consentRequest
- Name
- id
- Type
- string
- Description
Unique identifier for the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
- Name
- createdAt
- Type
- string
- Description
The timestamp at which the consent request was created.
Example:"2024-01-09T15:00:51Z"
- Name
- deliveryMethod
- Type
- nullable string
- Description
The method by which the consent request is delivered to the user.
Example:"emailLink"Allowed values:emailLinksmssmsLinksmsOTP
- Name
- expiredAt
- Type
- nullable string
- Description
The timestamp at which the consent request expired.
Example:"2024-01-09T15:00:51Z"
- Name
- operation
- Type
- string
- Description
The operation being requested.
Example:"exchange.sim"Allowed values:change.phoneNumberchange.providerexchange.simissue.portOutCredentialsportin.subscription
- Name
- status
- Type
- string
- Description
The status of the consent request.
Example:"pending"Allowed values:approvedbypassedcanceledexpiredpending
- Name
- subject
- Type
- string
- Description
The ID of resource being affected by the operation. It can be for example a port out ID, if the operation is
issue.portOutCredentials.Example:"pto_0SNlurA049MEWV4DWEaT4SaeDI8s"
- Name
- subscription
- Type
- string
- Description
Unique identifier for the subscription inferred from the resource associated with this consent request, e.g. a port-out, porting, or subscription change.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/consentRequests \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"fromConsentRequest": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
}'
Response 201
{
"object": "consentRequest",
"id": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU",
"createdAt": "2024-01-09T15:00:51Z",
"deliveryMethod": "emailLink",
"expiredAt": "2024-01-09T15:00:51Z",
"operation": "exchange.sim",
"status": "pending",
"subject": "pto_0SNlurA049MEWV4DWEaT4SaeDI8s",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
Retrieve a consent request
Retrieves a consent request by the given id.
Path Parameters
- Name
- consentRequest
- Type
- string
- Description
The unique identifier of the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
required
Responses
Returns the consent request if it exists.
- Name
- object
- Type
- string
- Description
Type of object is always
consentRequest.Allowed values:consentRequest
- Name
- id
- Type
- string
- Description
Unique identifier for the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
- Name
- createdAt
- Type
- string
- Description
The timestamp at which the consent request was created.
Example:"2024-01-09T15:00:51Z"
- Name
- deliveryMethod
- Type
- nullable string
- Description
The method by which the consent request is delivered to the user.
Example:"emailLink"Allowed values:emailLinksmssmsLinksmsOTP
- Name
- expiredAt
- Type
- nullable string
- Description
The timestamp at which the consent request expired.
Example:"2024-01-09T15:00:51Z"
- Name
- operation
- Type
- string
- Description
The operation being requested.
Example:"exchange.sim"Allowed values:change.phoneNumberchange.providerexchange.simissue.portOutCredentialsportin.subscription
- Name
- status
- Type
- string
- Description
The status of the consent request.
Example:"pending"Allowed values:approvedbypassedcanceledexpiredpending
- Name
- subject
- Type
- string
- Description
The ID of resource being affected by the operation. It can be for example a port out ID, if the operation is
issue.portOutCredentials.Example:"pto_0SNlurA049MEWV4DWEaT4SaeDI8s"
- Name
- subscription
- Type
- string
- Description
Unique identifier for the subscription inferred from the resource associated with this consent request, e.g. a port-out, porting, or subscription change.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/consentRequests/{consentRequest} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Response 200
{
"object": "consentRequest",
"id": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU",
"createdAt": "2024-01-09T15:00:51Z",
"deliveryMethod": "emailLink",
"expiredAt": "2024-01-09T15:00:51Z",
"operation": "exchange.sim",
"status": "pending",
"subject": "pto_0SNlurA049MEWV4DWEaT4SaeDI8s",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
Approves the consent request
Grants consent for the given request. This will trigger the consent request to be processed and the request to transition to the approved status. The consent request must be in the pending status in order to be approved.
Body
- Name
- code
- Type
- string
- Description
The OTP associated with the consent request, used to validate the given consent.
Example:"123456"
required
Path Parameters
- Name
- consentRequest
- Type
- string
- Description
The unique identifier of the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
required
Responses
Returns the consent request.
- Name
- object
- Type
- string
- Description
Type of object is always
consentRequest.Allowed values:consentRequest
- Name
- id
- Type
- string
- Description
Unique identifier for the consent request.
Example:"crq_0SNlurA049MEWV2jN9EvAfKMf7VU"
- Name
- createdAt
- Type
- string
- Description
The timestamp at which the consent request was created.
Example:"2024-01-09T15:00:51Z"
- Name
- deliveryMethod
- Type
- nullable string
- Description
The method by which the consent request is delivered to the user.
Example:"emailLink"Allowed values:emailLinksmssmsLinksmsOTP
- Name
- expiredAt
- Type
- nullable string
- Description
The timestamp at which the consent request expired.
Example:"2024-01-09T15:00:51Z"
- Name
- operation
- Type
- string
- Description
The operation being requested.
Example:"exchange.sim"Allowed values:change.phoneNumberchange.providerexchange.simissue.portOutCredentialsportin.subscription
- Name
- status
- Type
- string
- Description
The status of the consent request.
Example:"pending"Allowed values:approvedbypassedcanceledexpiredpending
- Name
- subject
- Type
- string
- Description
The ID of resource being affected by the operation. It can be for example a port out ID, if the operation is
issue.portOutCredentials.Example:"pto_0SNlurA049MEWV4DWEaT4SaeDI8s"
- Name
- subscription
- Type
- string
- Description
Unique identifier for the subscription inferred from the resource associated with this consent request, e.g. a port-out, porting, or subscription change.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/consentRequests/{consentRequest}/approve \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"code": "123456"
}'
Response 200
{
"object": "consentRequest",
"id": "crq_0SNlurA049MEWV2jN9EvAfKMf7VU",
"createdAt": "2024-01-09T15:00:51Z",
"deliveryMethod": "emailLink",
"expiredAt": "2024-01-09T15:00:51Z",
"operation": "exchange.sim",
"status": "pending",
"subject": "pto_0SNlurA049MEWV4DWEaT4SaeDI8s",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}