Darryn_Chang | 2017-03-16 05:04:21 UTC | #1
Hi, we are attempting to create a test flow that triggers a request to send an email to customers once they complete a transaction on our IVR. We have created a test bridge action and built a test flow in architect but I think the schema request is incorrect as we keep reaching the failed message and nothing is received in the 3rd party application.
Is there a particular json schema that needs to be included to be able to trigger an email after a customer completes a transaction similar to receiving a electronic receipt from a purchase?
This the request schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Trigger Email", "description": "Triggers an email from Campaign from a particular subscription", "type": "object", "properties": { "subscriberId": { "type": "string", "description": "Your subscriber Id" }, "eventType": { "type": "string", "description": "Message Center Event Type" }, "startDate": { "type": "string", "description": "Start date for Holiday Stop" }, "endDate": { "type": "string", "description": "End date for Holiday Stop" }, "publication": { "type": "string", "description": "Publication data" } }, "additionalProperties": true }
This is the response schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Trigger Email Response Status", "description": "The schema for the results of the trigger email call", "type": "object", "properties": { "status": { "type": "string", "description": "The status of your request" } }, "additionalProperties": true }
Richard.Schott | 2017-03-17 18:40:45 UTC | #2
I would start by checking that your web service is responding as expected by exercising the endpoints you have defined in the connector/action config and using the schema you've defined above. Once that is show to be behaving as expected, the next step is to exercise the bridge action directly. Here are some instructions I pulled from another forum post that was similar to yours:
The short version, if you’re already familiar with how things work on our side: Make a REST call to the following endpoint: /bridge/api/v1/actionCall/YOURACTIONNAMEHERE. This will accept a json entity which adheres to the Request Schema you have defined in setting up your connector, and will return a flattened version of the data as defined in your Response Schema. This is how your Call Bridge Action Step works when executing Architect flows.
The long, detailed version: From here, I will assume the following:
You have a Bridge Server installed: https://help.mypurecloud.com/articles/install-bridge-server/ You have a Web Services Datadip Connector installed and configured: https://help.mypurecloud.com/articles/about-web-services-data-dip-connector/ You have created and saved a Custom Action. NOTE: You do not need to Publish a custom action to test it. Also NOTE: If you publish an action, you will not be able to modify it, and must create a new action if you wish to change any of its schemas. You have set up Postman using the instructions here: https://developer.mypurecloud.com/api/rest/postman/index.html3 Once you are at this point, you will need to do the following to test your actions through our Bridge API:
The endpoint you will need to call is: https://apps.{{environment}}/bridge/api/v1/actionCall/YOURACTIONNAMEHERE, where YOURACTIONNAMEHERE corresponds to the name of your published Bridge action. The body of this request should be the same as the body for your Web Services server request. Be sure to set the content type to application/json in the headers. You should apply authorization in the same way as presented in the article above, with one caveat: once the bearer token is in the headers, you will need to ensure that the word "bearer" is all lowercase. Unfortunately, the Bridge API is case-sensitive about the word, and Postman, at least in my test environment, supplies a capital B. Assuming your data matches something that your Web Service will return, you should receive a flattened version of the return body. The flattening process moves everything from its nested objects to the top layer, with a '.' separating the layers. If your call does not return data, an error should be produced.
system | 2017-08-28 19:33:03 UTC | #3
This post was migrated from the old Developer Forum.
ref: 1058