SalesfroceからYoomに連携するためにOutbound Message を使ったのですがフローのアクションではレコードトリガーフローでしか使えなかったですね。自動起動フローでも使いたいのでApexからコールできないかを調べています。
まずは
Yoomで受け取ったOutbound Messageを眺めてみます
"Id": "a1XBC000000AxwT2AS"はYoomに渡したい情報を格納しているカスタムオブジェクトのIdです。
他にもIdらしきものがあるので確認すると
"OrganizationId": "00D9D0000001Lixxxx"
"ActionId": "04kBC00000060oXYAQ"
"Id": "04lBC0000003y7hYAA"
Key Prefix | Object Type | Notes |
---|---|---|
04k | ActionOutboundMessage | Outbound Message Id |
04l | OutboundMessage | Outbound Notification Id |
{
"Envelope": {
"xmlns:soapenv": "http://schemas.xmlsoap.org/soap/envelope/",
"xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"Body": {
"notifications": {
"xmlns": "http://soap.sforce.com/2005/09/outbound",
"OrganizationId": "00D9D0000001Lixxxx",
"ActionId": "04kBC00000060oXYAQ",
"SessionId": {
"xsi:nil": "true"
},
"EnterpriseUrl": "https://fukadadenki--dev3.sandbox.my.salesforce.com/services/Soap/c/64.0/00D9D0000001Lif",
"PartnerUrl": "https://fukadadenki--dev3.sandbox.my.salesforce.com/services/Soap/u/64.0/00D9D0000001Lif",
"Notification": {
"Id": "04lBC0000003y7hYAA",
"sObject": {
"xsi:type": "sf:FormOutput__c",
"xmlns:sf": "urn:sobject.enterprise.soap.sforce.com",
"Id": "a1XBC000000AxwT2AS"
}
}
}
}
}
}
検索してみるけど、対応してないうようです。
しかし、Yoom側ではこのURLでフックが掛かって、"Id": "a1XBC000000AxwT2AS"が取得できればいい。念のためにセキュリティー上は"OrganizationId": "00D9D0000001Lixxxx"の組織からのフックだけに反応すればいいので、
ActionOutboundMessageとOutboundMessageのIdはなくても機能するかもしれません。
試しに適当なIdを振ってYomm側で機能するかを確かめてみましょう。
試してみたら...
直接Postしても機能してますねぇ。