Testing

Testing

Overview

πŸ’‘
This feature only applies to the sandbox environment

These features allow you to automate acceptance or rejection of validation checks at the point of creation. This helps you test your implementation without the verification stages requiring human intervention. By specifying certain values in certain fields, you can automatically trigger a desired event to enable your testing program. Other than these exceptions, queries are created in the same way as production queries.

Please Note ⚠️

All automatic actions will be applied after the POST action. This means that the response of the POST actions will not have the value of the specified automatic actions. They will be available at the next GET call.

Validation Request

πŸ’‘
Validation requests are made via the Validation request API

The field responsible for calling automatic actions on validation request is name. Create your request using the documentation as usual, and in the name field enter one of the possible values below depending on what you are aiming to achieve.

For accepting a validation request use the below in the name field:

β†’ test_accept

For rejecting a validation request select one of the following and use this in the name field: β†’ test_reject_other

β†’ test_reject_not_eligible

β†’ test_reject_incorrect_documentation

β†’ test_reject_not_attributable_to_registry

API example

β€£

POST - Create a Validation request Request Body

// POST /v1/validation-requests
{
  "name": "test_accept",
  "registryName": "test data",
  "registryId": "6442122137",
  "website": "https://www.website.com",
  "countryCode": "GBR",
  // optional fields omitted
  // see API reference for full payload
}
β€£

GET - Expected validation request Response

// GET /v1/validation-requests/:id
{
  "data": {
		"id": "sandbox_validationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "name": "test_accept",
    "registryName": "test data",
    "registryId": "6442122137",
    "email": null,
    "addressLine1": null,
    "addressLine2": null,
    "city": null,
    "state": null,
    "postal": null,
    "website": "https://www.website.com",
    "countryCode": "GBR",
    "createdAt": "2023-02-17T13:18:03.194Z", // ISO 8601 standard
    "deletedAt": null,
    "acceptedAt": "2023-02-17T13:18:04.224Z", // <-- request accepted - ISO 8601 standard
    "rejectedAt": null,
    "organisationId": "sandbox_organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "rejectionReason": null,
    "usaGroupExempt": null,
    "rejectionReasonCode": null,
    "documents": []
  },
  "object": "validation_request"
}

Agent Verification

πŸ’‘
Agent verification requests are made via the Agent Verification API

The field responsible for calling automatic actions in agent verification is firstName.

Create your request using the API reference as usual, and in the firstName field enter one of the possible values below depending on what you are aiming to achieve.

For accepting the Agent Verification use the below in the firstName field:

β†’ test_accept

For rejecting the Agent Verification use one of the below in the firstName field:

β†’ test_reject_validation_request_failed

β†’ test_reject_user_verification_expired

β†’ test_reject_user_failed_percent_review

β†’ test_reject_reapply

β†’ test_reject_fake_email_used

β†’ test_reject_no_online_presence

β†’ test_reject_nonprofit_association_expired

β†’ test_reject_other

API example

β€£

POST - Create an Agent Verification Request Body

You can use a validationRequestId or an organisationId in your query. Based on your choice the response will contain the appropriate specific fields. In the example below the validationRequestId field is used.

// POST /v1/agent-verifications
{
  "firstName": "test_accept",
  "lastName": "test lastname",
  "email": "email@domain.com",
  "validationRequestId": "sandbox_validationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  // optional fields omitted
  // see API reference for full payload
}
β€£

GET - Retrieve an Agent Verification Response

// GET /v1/agent-verifications/:id
{
  "data": {
    "id": "sandbox_agentverification_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "firstName": "test_accept",
    "lastName": "test lastname",
    "createdAt": "2023-02-17T13:31:02.367Z", // ISO 8601 standard
    "email": "email@domain.com",
    "validationRequestId": "sandbox_validationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "organisationId": "sandbox_organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "title": null,
    "status": "approved", // <-- Agent is approved
    "rejectionReason": null,
    "language": "en",
    "metadata": null,
    "externalActionRequired": false,
    "rejectionReasonCode": null
  },
  "object": "agent_verification"
}

Monitoring Subscription

πŸ’‘
Monitoring subscription requests are made via the Monitoring API

The field responsible for calling automatic actions on monitoring is organisationId or validationRequestId.

To trigger an auto accept or reject action, append one of the values below to the ID of the organisationId or validationRequestId field:

β†’ -complianceStatus:pass

β†’ -complianceStatus:fail

Based on your choice the response will contain the appropriate specific fields. In the example below we use the organisationId field and we will send the pass parameter. Using this method returns all results with a status of clear.

API example

β€£

POST - Create a Monitoring Subscription Request Body

// POST /v1/monitoring-subscriptions
{
  organisationId: "sandbox_organisationRequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx-complianceStatus:pass"
}

You can check your subscription status using /v1/monitoring-subscriptions/{id}

β€£

GET - Retrieve a Monitoring Subscription Response

// GET /v1/monitoring-subscriptions/:id
{
  "data": {
    "id": "sandbox_monitoringsubscription_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "organisationId": "sandbox_organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "validationRequestId": null,
    "createdAt": "2023-02-16T13:31:12.172Z", // ISO 8601 standard
    "status": "live",
    "organisation": {
      "name": "test_accept"
    },
    "results": {
      "controversial": {
         "status": "clear"
       },
       "hateSpeech": {
         "status": "clear"
       },
       "commercial": {
         "status": "clear"
       },
       "adverseMedia": {
         "status": "clear"
       },
       "sanction": {
         "status": "clear"
       },
       "warning": {
         "status": "clear"
       },
       "complianceStatus": "pass", // <-- compliance status passed
       "registration": {
         "active": "yes"
       }
    }
  },
  "object": "monitoring_subscription"
}

By default, all parameters for monitoring will be set to clear when calling the pass action. In the case of invoking the fail action, they will have the value flag.

To overwrite the default value for a particular parameter, add the parameter with the value at the end of the organisationId or validationRequestId.

List of possible parameters:

β†’ warning

β†’ sanction

β†’ hateSpeech

β†’ compliance

β†’ commercial

β†’ adverseMedia

β†’ controversial

Additional parameters values:

β†’ flag

β†’ clear

API example with parameters

For example, if you want to flag commercial and adverseMedia for an organisation you have to add -commercial:flag-adverseMedia:flag to the end of the field.

β€£

POST - Create a Monitoring Subscription Request

// POST /v1/monitoring-subscriptions
{
 "organisationId": "sandbox_organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx-complianceStatus:pass-adverseMedia:flag-commercial:flag"
}
β€£

GET - Retrieve a Monitoring Subscription Response

// GET /v1/monitoring-subscriptions/:id
{
  "data": {
    "id": "sandbox_monitoringsubscription_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "organisationId": "sandbox_organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "validationRequestId": null,
    "createdAt": "2023-02-16T13:31:12.172Z", // ISO 8601 standard
    "status": "live",
    "organisation": {
      "name": "test_accept"
    },
    "results": {
      "controversial": {
         "status": "clear"
       },
       "hateSpeech": {
         "status": "clear"
       },
       "commercial": {
         "status": "flag" // <-- this is flagged
       },
       "adverseMedia": {
         "status": "flag" // <-- this is flagged
       },
       "sanction": {
         "status": "clear"
       },
       "warning": {
         "status": "clear"
       },
       "complianceStatus": "pass", // <-- overall pass
       "registration": {
         "active": "yes"
       }
    }
  },
  "object": "monitoring_subscription"
}

Eligibility Request

πŸ’‘
Validation requests are made via the Eligibility API

The field responsible for calling automatic actions on Eligibility is suggestedActivitySubTags. Create your request using the documentation as usual, and in the suggestedActivitySubTags field enter one of the possible values below depending on what you are aiming to achieve. Please note that this field takes an array.

To accept an eligibility request use the below in the suggestedActivitySubTags field:

β†’ ["test_pass"]

To fail an eligibility request use the following in the suggestedActivitySubTags field: β†’ ["test_fail"]

API examples

β€£

POST - Create Eligibility Subscription Request Body

// POST /v1/eligibility-subscriptions
{
	organisationId: "organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  suggestedActivitySubTags: ["test_pass"]
}
β€£

GET - Create an Eligibility Subscription Response

// GET /v1/eligibility-subscriptions/:id
{
	"data": {
	"id": "eligibilitysubscription_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"organisationId": "organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"organisationName": "string",
	"validationRequestId": "validationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"suggestedActivitySubTags": [],
	"status": "live",
	"results": {
	"eligibilityStatus": "pass", // <-- eligibility passed
	"confirmedActivitySubTags": [
		{
		"id": "activitysubtag_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
		"name": "Sport school",
		"tag": {},
		"description": "string",
		"createdAt": "2020-10-13T17:46:54.000Z", // ISO 8601 standard
		"updatedAt": "2020-10-13T17:46:54.000Z" // ISO 8601 standard
		}
	]
	},
	"createdAt": "2020-10-13T17:46:54.000Z",
	"updatedAt": "2020-10-13T17:46:54.000Z"
	},
	"object": "eligibility_subscription"
}

πŸ’ 
https://poweredbypercent.com/

Footer Social Icons

Β© 2022 We Are Percent Ltd.