MarketingCloudSession cannot fetch a fresh token, because it is trying to fetch "requestToken_url". This does not exist, and should be changed to "request_token_url".

This is because recent changes to make marketing_cloud config settings standard and follow snake case have not been fully migrated to MarketingCloudSession.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

john_a created an issue. See original summary.

john_a’s picture

Status: Active » Needs review
FileSize
772 bytes

Patch created, please review

john_a’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested by self, using marketing_cloud_example.

Testing steps (these should have been included in the ticket description):

  1. Install marketing_cloud_example with all dependencies.
  2. Configure marketing_cloud with valid business unit API credentials (so that the token request can return a valid token).
  3. Configure marketing_cloud_example form handler with a valid text message template (not necessary).
  4. Submit the webform with a dummy mobile number and text message.

Expected results

drupal message

Message not sent - errors: 400 Bad Request

watchdog message

"Client error: `POST https://www.exacttargetapis.com/sms/v1/messageContact/<short_code>/send` resulted in a `400 Bad Request` response:@"errors":["No valid subscribers were provided."]"
The watchdog message would show that a valid token has been sent in the request, but then failed because the dummy mobile number is not a valid subscriber in Salesforce, and so returns a bad request error.

Actual result

drupal message

Message not sent - errors: 400 Bad Request

watchdog message

Fetching a new token.

"Client error: `POST https://www.exacttargetapis.com/sms/v1/messageContact/<short_code>/send` resulted in a `400 Bad Request` response:@"errors":["No valid subscribers were provided."]"

Message not sent - errors: 400 Bad Request

Patch applied cleanly and the results are as expected.

john_a’s picture

Status: Reviewed & tested by the community » Fixed

patch applied

john_a’s picture

Status: Fixed » Closed (fixed)