• Francois Lefebvre
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hello,

I am trying to use the SOAP API, authenticating using the newest OAuth 2.0 features (Using the new "enhanced features" installed package), however any SOAP requests I make result in a "Error: API Permission Failed."

I have played around with the package's permission, re-created the packages, on several instances, always with the same results.  The moment I revert back to using a token obtained via the Legacy package the requests work as expected.

Below is an example request/response for a simple request to retrieve data extensions:
 
=========== Request ===========
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
  <SOAP-ENV:Header>
    <SOAP-ENV:fueloauth>ZKCQIyLMVJoSXYIAFuvk3r6a</SOAP-ENV:fueloauth>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:RetrieveRequestMsg>
      <ns1:RetrieveRequest>
        <ns1:ObjectType>DataExtension</ns1:ObjectType>
        <ns1:Properties>Name</ns1:Properties>
        <ns1:Properties>CustomerKey</ns1:Properties>
        <ns1:Properties>CategoryID</ns1:Properties>
      </ns1:RetrieveRequest>
    </ns1:RetrieveRequestMsg>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="utf-8"?>

=========== Response ===========
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <soap:Header>
    <wsa:Action>RetrieveResponse</wsa:Action>
    <wsa:MessageID>urn:uuid:432bc01d-4a73-47b4-961b-470ed5f0a9ff</wsa:MessageID>
    <wsa:RelatesTo>urn:uuid:85e421bf-ce04-4bcf-a86c-7643edb63ea2</wsa:RelatesTo>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsse:Security>
      <wsu:Timestamp wsu:Id="Timestamp-9e129000-dbc7-4146-9772-edcaf925da47">
        <wsu:Created>2019-03-04T21:02:49Z</wsu:Created>
        <wsu:Expires>2019-03-04T21:07:49Z</wsu:Expires>
      </wsu:Timestamp>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <OverallStatus>Error: API Permission Failed.</OverallStatus>
      <RequestID>a96f0362-7754-4b7f-94c9-988fa314558c</RequestID>
    </RetrieveResponseMsg>
  </soap:Body>
</soap:Envelope>

I have also attached a screenshot showing the configuration of the API component in my package.

User-added image

It seems as though the permissions are not being applied correctly.  Is there any additional steps I might be missing to be able to use OAuth 2.0 with SOAP API requests ?  Any other insights regarding this issue?

Thank you!
Hello,
We are using the Bulk API to insert records in a custom object, which uses a Master-Detail field to the Contact object. 
I am sending my data in JSON format.  Here is a sample of that payload:  (Contact__r is the Relationship Name of the Master-Detail field)
[
    {
        "Subscriber_Key__c": "0030a00001sjeAXAAY",
        "Contact__r": {
            "Id": "0030a00001sjeAXAAY"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827818",
        "Email_Address__c": "shelby@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Send",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Send",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0031800000UnAxwAAF",
        "Contact__r": {
            "Id": "0031800000UnAxwAAF"
        },
        "Job_Id__c": "57113",
        "Subscriber_ID__c": "34693791",
        "Email_Address__c": "lennie@email.com",
        "Email_Name__c": "Abandoned Page",
        "Email_Subject__c": "%%First Name%%, you can still get discounted registration and free swag",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Click",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-07",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0031800000UnAxwAAF",
        "Contact__r": {
            "Id": "0031800000UnAxwAAF"
        },
        "Job_Id__c": "57113",
        "Subscriber_ID__c": "34693791",
        "Email_Address__c": "lennie@email.com",
        "Email_Name__c": "Abandoned Page",
        "Email_Subject__c": "%%First Name%%, you can still get discounted registration and free swag",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-07",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a00001sjeAXAAY",
        "Contact__r": {
            "Id": "0030a00001sjeAXAAY"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827818",
        "Email_Address__c": "shelby@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    }
]
However, the result of the Bulk API is always that the Id field of Contact is not an External ID or not indexed. 
[
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    }
]
I was under the impression that the ID field of standard object is always indexed by default.  Is there anything else that need to be done to either the custom object or Contact to allow the lookup ?

Any advice or insight would be much appreciated.

Thank you!
Cheers,

Francois
Hello,
We are using the Bulk API to insert records in a custom object, which uses a Master-Detail field to the Contact object. 
I am sending my data in JSON format.  Here is a sample of that payload:  (Contact__r is the Relationship Name of the Master-Detail field)
[
    {
        "Subscriber_Key__c": "0030a00001sjeAXAAY",
        "Contact__r": {
            "Id": "0030a00001sjeAXAAY"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827818",
        "Email_Address__c": "shelby@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Send",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Send",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0031800000UnAxwAAF",
        "Contact__r": {
            "Id": "0031800000UnAxwAAF"
        },
        "Job_Id__c": "57113",
        "Subscriber_ID__c": "34693791",
        "Email_Address__c": "lennie@email.com",
        "Email_Name__c": "Abandoned Page",
        "Email_Subject__c": "%%First Name%%, you can still get discounted registration and free swag",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Click",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-07",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0031800000UnAxwAAF",
        "Contact__r": {
            "Id": "0031800000UnAxwAAF"
        },
        "Job_Id__c": "57113",
        "Subscriber_ID__c": "34693791",
        "Email_Address__c": "lennie@email.com",
        "Email_Name__c": "Abandoned Page",
        "Email_Subject__c": "%%First Name%%, you can still get discounted registration and free swag",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-07",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a00001sjeAXAAY",
        "Contact__r": {
            "Id": "0030a00001sjeAXAAY"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827818",
        "Email_Address__c": "shelby@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": true,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    },
    {
        "Subscriber_Key__c": "0030a000024Mv81AAC",
        "Contact__r": {
            "Id": "0030a000024Mv81AAC"
        },
        "Job_Id__c": "72299",
        "Subscriber_ID__c": "35827820",
        "Email_Address__c": "brady@email.com",
        "Email_Name__c": "Early Bird Template Based Email - 20181211_132833",
        "Email_Subject__c": "test email",
        "Dynamic_Email_Subject__c": "",
        "From_Name__c": "Pittsburgh Three Rivers Marathon, Inc. (P3R)",
        "From_Email__c": "Long@email.com",
        "Event_Type__c": "Open",
        "Event_Sub_Type__c": "",
        "Event_Date__c": "2019-01-08",
        "Is_Unique__c": false,
        "URL__c": "",
        "Account__c": "100012345",
        "Business_Unit_Id__c": "100012345"
    }
]
However, the result of the Bulk API is always that the Id field of Contact is not an External ID or not indexed. 
[
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    },
    {
        "success": false,
        "created": false,
        "id": null,
        "errors": [
            {
                "message": "Field name provided, Id is not an External ID or indexed field for Contact",
                "fields": [],
                "statusCode": "INVALID_FIELD",
                "extendedErrorDetails": null
            }
        ]
    }
]
I was under the impression that the ID field of standard object is always indexed by default.  Is there anything else that need to be done to either the custom object or Contact to allow the lookup ?

Any advice or insight would be much appreciated.

Thank you!
Cheers,

Francois