Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  How to write DataAction

    Posted 06-05-2025 18:41

    makoto10 | 2020-09-17 16:57:37 UTC | #1

    Hi,

    I want to do API integration with a CRM system.

    I would like to ask the following questions.

    • I want to set the action of Genesys Cloud in the format that was successfully executed by API Test Tool (I will upload the file later)
    • Genesys Cloud contract and request template are not written correctly
    • I also attach the contract (input) and request parameters that I set.

    Currently, the execution result of DataAction is as follows.


    Step.8 Excute { "message": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "code": "internal.server.error", "status": 500, "messageParams": {}, "contextId": "1d84fc1c-722d-4809-8e63-3af638fb335c", "details": { "errorCode": "ACTION.REMOTE_ENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:We were unable to process the response from the remote endpoint ([stg.tirepit.jp because it had a 'content-type' header of 'text/html' instead of the required value of 'application/json'. [1d84fc1c-722d-4809-8e63-3af638fb335c]", "code": "INTERNAL_SERVER_ERROR", "status": 200, "messageParams": {}, "details": [], "errors": [] } ] }


    Regards,


    tim.smith | 2020-09-17 15:04:25 UTC | #2

    The service you're trying to use at stg.tirepit.jp must return a JSON payload. If this is not a service you have control over, you will need to create a middleware application that communicates using proper JSON requests and responses to proxy communication with the non-JSON service.


    makoto10 | 2020-09-17 16:56:47 UTC | #3

    Hi Smith,

    Thank you for your reply. I understood from another discussion that the format of Response must be JSON, and this problem was cleared.

    However, as the next issue, as a result of using the JSON method together with the request / response, the API Tester works normally, but the DataAction does not POST the parameters.

    I want to do the same thing as API Tester (Chrome Extention) with DataAction, but is the Request Template written incorrectly?

    Attached Files - Tester.jpg -> Success

    My Contract(input) -

    { "$schema": "http://json-schema.org/draft-04/schema#", "title": "request", "description": "For Autoway", "type": "object", "properties": { "tel": { "description": "tel", "default": "09011112222", "type": "string" }, "hashkey": { "description": "hashkey", "default": "c8cd2dc70879f4d0da6c2de3ca620dccb53ec43e7050696ccff252658adc3a94", "type": "string" } }, "additionalProperties": true }

    My Configuration(Request)

    { "requestUrlTemplate": "https://stg.tirepit.jp/api/Get_store_name?developerId=loop", "requestType": "POST", "headers": { "Content-Type": "application/json" }, "requestTemplate": "{\"tel\": \"${input.tel}\", \"hashkey\": \"${input.hashkey}\"}" }

    Is it written incorrectly?

    Sorry...


    Jerome.Saint-Marc | 2020-09-17 16:23:38 UTC | #4

    Hello,

    I think your Configuration Request should be as follows:

    { "requestUrlTemplate": "https://stg.tirepit.jp/api/Get_store_name?developerId=loop", "requestType": "POST", "headers": { "Content-Type": "application/json" }, "requestTemplate": "{\"tel\": \"${input.tel}\", \"hashkey\": \"${input.hashkey}\"}" }

    Regards,


    makoto10 | 2020-09-17 17:02:47 UTC | #5

    Hi,

    I changed it according to your advice and tried it, but it still didn't give the same result as API Tester.

    I also tried running it on Postman, but it worked fine on Postman as follows.

    Do you know the difference from DataAction?

    Sorry,


    Jerome.Saint-Marc | 2020-09-17 17:05:10 UTC | #6

    Hello,

    I am not sure I understand what you mean when you say it didn't give the same result as API tester. What errors do you get when you try to execute the Data Action request?

    Regards,


    makoto10 | 2020-09-17 18:02:03 UTC | #7

    Hi,

    We apologize for not being able to provide accurate information.

    This event has been resolved. The cause was "Transfer-Encording".

    Thank you.


    Jerome.Saint-Marc | 2020-09-18 05:32:11 UTC | #8

    Hello,

    Really no need to apologize at all. I am glad you could identify the source of the problem and resolve it. :slight_smile:

    Regards,


    system | 2020-10-19 05:42:10 UTC | #9

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


    This post was migrated from the old Developer Forum.

    ref: 8841