Legacy Dev Forum Posts

 View Only

Sign Up

Fail to create new schema (External Contacts)

  • 1.  Fail to create new schema (External Contacts)

    Posted 06-05-2025 18:32

    Clayton_Santos | 2024-10-01 14:20:26 UTC | #1

    Hi,

    Recently I'm trying to create a new schema using the API at this endpoint /api/v2/externalcontacts/organizations/schemas, but I'm getting a 403 (missing.any.permissions).

    Checking the permissions, I already have all the permissions for external contacts activated and I still can't connect. I didn't find any permission with the description [externalContacts:customFields:add]. I would like some help to create this schema.

    My code:

    def create_instance():
        CLIENT_ID= ""
        CLIENT_SECRET= ""
    
        region = PureCloudPlatformClientV2.PureCloudRegionHosts.sa_east_1
        PureCloudPlatformClientV2.configuration.host = region.get_api_host()
        api_client = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(CLIENT_ID, CLIENT_SECRET)
        authApi = PureCloudPlatformClientV2.AuthorizationApi(api_client)
        api_instance = PureCloudPlatformClientV2.ExternalContactsApi(api_client)
        return api_instance
    
    def request(instance):
        body = PureCloudPlatformClientV2.DataSchema()
        # body.id = "vipSchema"
        body.name = "Vip"
        body.version = 1
        body.enabled = True
        body.json_schema = {"id": "vipSchema",
                            "$schema":"http://json-schema.org/draft-07/schema#",
                            "title": "Vip",
                            "description": "Vip schema to companys",
                            "type": "object",
                            "required":["status"],
                            "properties":{"status": {"type": "boolean", "description": "schema True or False"}},
                            "additionalProperties": False}
        
        response = instance.post_externalcontacts_organizations_schemas(body)
        return response
        
    def main():
        instance = create_instance()
        response = request(instance)

    Response:

    PureCloudPlatformClientV2.rest.ApiException: (403) Reason: Forbidden HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Content-Length': '277', 'Connection': 'keep-alive', 'Date': 'Tue, 01 Oct 2024 13:19:16 GMT', 'ININ-Correlation-Id': '59477a56-3928-4b6c-9ad5-cafa9be8911a', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 11715c60f8f24aceeeb0e30b38755788.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'GIG51-P1', 'X-Amz-Cf-Id': 'AxrUzH-ibXXWooDhnzpMJhVkINVIgU88lt-ikAyPVFtC9LICOQgA=='}) HTTP response body: {"message":"Unable to perform the requested action. You must have at least one of the following permissions assigned: [externalContacts:customFields:add]","code":"missing.any.permissions","status":403,"contextId":"59477a56-3928-4b6c-9ad5-cafa9be8911a","details":[],"errors":[]}


    tim.smith | 2024-10-01 14:29:11 UTC | #2

    Clayton_Santos, post:1, topic:29642
    externalContacts:customFields:add

    This is a valid permission. If you don't have it in your org, it's likely because your org is not licensed for this feature. You can work with your TAM to begin the license purchase process. If you believe you have already purchased the appropriate licenses for this feature, please open a case with Genesys Cloud Care to investigate further as we do not have access to your org's data via the forum.


    Clayton_Santos | 2024-10-01 17:04:56 UTC | #3

    I understand, my license probably doesn't have this feature. Thanks!


    system | 2024-10-31 17:05:32 UTC | #4

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 29642