ãããŒãèšèšãã
åŠç¿ã®ç®ç
ãã®åå ãå®äºãããšã次ã®ããšãã§ããããã«ãªããŸãã
- ãããŒã®èšèšã®æºåãããã
- Salesforce ã§æ°èŠäœæãŸãã¯æŽæ°ãããååŒå 責任è ã Square ã®é¡§å®¢ã«èªåçã«åæãããããŒãèšå®ããã
ãããŒã®èšèšã®æºåããã
ãMuleSoft Composer ã®åºæ¬ãã§èª¬æããããã«ããããŒã¯ã·ã¹ãã ãšããŒã¿ãçµ±åããããã«çµã¿åãããŠèšå®ããäžé£ã®ã¹ãããã§ãããããŒãèšèšããåã«ããããŒãã£ãŒãã䜿çšããŠãããŒã®äž»ãªã¹ããããæãåºãããšããå§ãããŸããäžé£ã®æµããçŽã«æãåºããšãã©ã®ãããªãããŒã«ãªããææ¡ãããããªããŸãã
以äžã¯ãåã®åå ã§èª¬æãã NTO ã®ãŠãŒã¹ã±ãŒã¹ã®ã€ã³ãã°ã¬ãŒã·ã§ã³ãããŒã®äž»ãªã¹ãããã瀺ããããŒãã£ãŒãã®äžäŸã§ãã
以äžã«ããã® NTO ã®ãŠãŒã¹ã±ãŒã¹ã®ãããŒãäœæããããã®ã¿ã¹ã¯ãšé¢é£ãããããŒã³ã³ããŒãã³ãã«ã€ããŠè©³ãã説æããŸãã
ã¿ã¹ã¯ |
ãããŒã³ã³ããŒãã³ã |
---|---|
æ°èŠäœæãŸãã¯æŽæ°ããã NTO ã®ååŒå 責任è ãèŠã€ããã |
æ°èŠäœæãŸãã¯æŽæ°ãããååŒå 責任è å ã«é¢ãã NTO çµç¹ããã®ããªã¬ãŒã |
察å¿ãã Square ã®é¡§å®¢ãæ€çŽ¢ããã |
ååŒå 責任è ãšåãã¡ãŒã«ã¢ãã¬ã¹ãæã€ãã¹ãŠã®é¡§å®¢ãæ€çŽ¢ããã¢ã¯ã·ã§ã³ã¹ãããã |
顧客ã®ãªã¹ããå埩åŠçããã |
顧客ã®ãªã¹ããå埩åŠçãã For Each ãããã¯ã |
顧客ãªã¹ãã空ã§ãªããã©ãããšæŽæ°ãŠãŒã¶ãŒãã³ã³ããŒã¶ãŒãŠãŒã¶ãŒã§ã¯ãªããã©ããã調ã¹ãã |
顧客ãªã¹ãã空ã§ãªããã©ãããšãæŽæ°ãŠãŒã¶ãŒãã³ã³ããŒãã³ããŠãŒã¶ãŒã§ãªããã©ãããè©äŸ¡ãã For Each ãããã¯å ã® If/Else ãããã¯ã |
顧客ãªã¹ãã空ã§æŽæ°ãŠãŒã¶ãŒãã³ã³ããŒãã³ããŠãŒã¶ãŒã§ãªãå Žåãã€ãŸã察å¿ãã顧客ãååšããå Žå:
|
If/Else ãããã¯ã§æ¬¡ã®ããšãå®è¡ããã
|
察å¿ãã顧客ãååšããªãå Žå:
|
顧客ãªã¹ãã空ãã©ãããè©äŸ¡ãã 2 çªç®ã® If/Else ãããã¯ã§æ¬¡ã®ããšãå®è¡ããã
|
MuleSoft Composer ã§ã¯ããã©ã«ãã§äœæ¥ãæ€èšŒãããæé ã®åã¹ãããã«ã¢ããªã±ãŒã·ã§ã³å ã³ã³ããã¹ããã«ãã衚瀺ãããŸããããšãã°ãã·ã¹ãã ã«æ¥ç¶ãè¿œå ãããšãMuleSoft Composer ã§æ¥ç¶ããã¹ãããããããæ£åžžã«æ©èœããããšã確èªããããã§æ¬¡ã®ã¹ãããã«é²ãããšãã§ããŸãããŸããåã¹ãããå ã®å¿ é é ç®ãå ¥åããããã« MuleSoft Composer ããæ±ããããŸããããã§ãããŒã®äœæãç°¡åã«ãªããŸãã
ãããŒã®äœæã®ãã¹ããã©ã¯ãã£ã¹ã¯ãæ°ã¹ãããããšã«ãã¹ããç¹°ãè¿ããªãããããŒãå®æãããããšã§ãã
次ã®ãã¢åç»ã§ãMuleSoft Composer ã䜿çšã㊠Salesforce ã®ååŒå 責任è ã Square ã®é¡§å®¢ã«åæããæ¹æ³ãã芧ãã ããã
ãããŒãèšèšãã
Salesforce ã§æ°èŠäœæãŸãã¯æŽæ°ãããååŒå 責任è ã Square ã®é¡§å®¢ãšèªåçã«åæããã€ã³ãã°ã¬ãŒã·ã§ã³ãããŒãèšèšããæºåãæŽããŸããã
åå 1 ã§åŠç¿ããããã«ããããŒã®å®è¡æã«ç¡éã«ãŒãã«é¥ã£ãŠããŸãåé¡ãåé¿ããã«ã¯ããããŒãèšèšããéã«ã³ã³ããŒã¶ãŒã®ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã䜿çšã㊠NTO çµç¹ãžã®æ¥ç¶ãäœæããŸãã
次ã®æé ã«åŸã£ãŠãããŒãèšèšããŸãã
NTO çµç¹ãã MuleSoft Composer ãèµ·åããŸãã
- ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã䜿çšã㊠NTO çµç¹ã«ãã°ã€ã³ããŸãã
- ã¢ããªã±ãŒã·ã§ã³ã©ã³ãã£ãŒã«
Composer
ãšå ¥åã㊠[MuleSoft Composer] ãéžæããŸãã
æ°ãããããŒãäœæããŸãã
- [Create New Flow (æ°èŠãããŒã®äœæ)] ãã¯ãªãã¯ããŸãã
- ããã©ã«ãã®ãããŒåã®æšªã«ããéçã¢ã€ã³ã³ãã¯ãªãã¯ããŸãã
- ãããŒã«
Sync Salesforce Contacts to Square Customers
(Salesforce ã®ååŒå 責任è ã Square ã®é¡§å®¢ã«åæ) ãšååãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãã
NTO Sandbox çµç¹ã®æ¥ç¶ã䜿çšããŠãããŒã®ããªã¬ãŒãäœæããŸãã
- [Salesforce] ãã¯ãªãã¯ããŸãã
-
[Add new Salesforce connection (æ°ãã Salesforce æ¥ç¶ãè¿œå )] ãã¯ãªãã¯ããNTO Sandbox çµç¹ãžã®æ¥ç¶ãäœæããŸãã
ã¡ã¢: åããŠã® Salesforce æ¥ç¶ã®å Žåããã®ãªãã·ã§ã³ã¯è¡šç€ºãããŸããã次ã®ã¹ãããã«é²ã¿ãŸãã - ãã®æ¥ç¶ã«
NTO sandbox org
(NTO Sandbox çµç¹) ãšååãä»ããŸãã -
[This is a sandbox organization (ãã㯠Sandbox çµç¹ã§ã)] ãã§ãã¯ããã¯ã¹ããªã³ã«ããŠã[Create (äœæ)] ãã¯ãªãã¯ããŸãã
ã¡ã¢: éçºè çµç¹ã䜿çšããå Žåã¯ããã®ãã§ãã¯ããã¯ã¹ã®éžæãã¹ãããããŠã[Create (äœæ)] ãã¯ãªãã¯ããŸãã - NTO Sandbox çµç¹ã®ãŠãŒã¶ãŒåãšãã¹ã¯ãŒããå ¥åããŠã[Log In to Sandbox (Sandbox ã«ãã°ã€ã³)] ãã¯ãªãã¯ããŸãã
- [Allow (èš±å¯)] ãã¯ãªãã¯ããŠãMuleSoft Composer ã«ãAccess the identity URL service (ID URL ãµãŒãã¹ã«ã¢ã¯ã»ã¹)ããManage user data via APIs (API ã䜿çšããŠãŠãŒã¶ãŒããŒã¿ã管ç)ããPerform requests at any time (ãã€ã§ãèŠæ±ãå®è¡)ãæš©éãä»äžããŸããMuleSoft Composer ã§æ¥ç¶ãèªåçã«ãã¹ããããŸãããšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŠããªãå Žåã¯æ¥ç¶ã確ç«ããããããŒã®æåã®ã¹ããã (ããªã¬ãŒ) ã衚瀺ãããŸãã
NTO çµç¹ã§ååŒå 責任è ãäœæãŸãã¯æŽæ°ããããã³ã«ãããŒãéå§ããããªã¬ãŒãèšå®ããŸãã
- [Choose an event that starts this flow (ãã®ãããŒãéå§ããã€ãã³ããéžæ)] é ç®ãã¯ãªãã¯ããŠã[New or updated record (ã¬ã³ãŒãã®æ°èŠäœæãŸãã¯æŽæ°)] ãéžæããŸãã
- [Object Type (ãªããžã§ã¯ãçš®å¥)] é ç®ãã¯ãªãã¯ã㊠[Contact (ååŒå 責任è å )] ãéžæããŸãã
- [Sample Output (ãµã³ãã«åºå)] ã»ã¯ã·ã§ã³ãèŠããšãNTO çµç¹ã®ååŒå
責任è
ã®é
ç®ãšããã«é¢é£ä»ããããŠãããµã³ãã«å€ã衚瀺ãããŠããŸããããã§ãæ£ããçµç¹ã«æ¥ç¶ãããŠããããšã確èªã§ãããããŒã®ä»åŸã®ã¹ãããã§äœ¿çšã§ããããŒã¿ã®æ§é ãããããŸãã
- [Save (ä¿å)] ãã¯ãªãã¯ããŠãããŒãä¿åããŸãã
Square Sandbox æ¥ç¶ã䜿çšããŠããããŒã® 2 çªç®ã®ã¹ããããäœæããŸãã
- ãã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ããŠã¹ããããè¿œå ããŸãã
- [HTTP] ãã¯ãªãã¯ãã[Add new HTTP connection (æ°ãã HTTP æ¥ç¶ãè¿œå )] ãã¯ãªãã¯ããŸãã
- ãã®æ¥ç¶ã«
NTO Square sandbox
ãšååãä»ããŸãã - [Authorization Type (æ¿èªçš®å¥)] é ç®ã§ã[Bearer Token (ãã¢ã©ãŒããŒã¯ã³)] ãéžæããŸãã
- åå
1 ã§ååŸããããã¹ããã¡ã€ã«ããããŒã¹ URL ãã³ããŒããŠã[Base URL (ããŒã¹ URL)] é
ç®ã«è²Œãä»ããŸãããã®ãŠãŒã¹ã±ãŒã¹ã§ã¯
https://connect.squareupsandbox.com
ã§ãã - åãããã¹ããã¡ã€ã«ãã Square Sanïœbox ã¢ã¯ã»ã¹ããŒã¯ã³ãã³ããŒããŠã[Token (ããŒã¯ã³)] é ç®ã«è²Œãä»ããŸãã
- [Next (次ãž)] ãã¯ãªãã¯ããŸãã
- [Request Method (èŠæ±ã¡ãœãã)] é ç®ã§ã[GET] ãéžæããŸãã
- [Request Path (èŠæ±ãã¹)] é
ç®ã«ã
/v2/customers
ãšå ¥åããŸãã - [Connect (æ¥ç¶)] ãã¯ãªãã¯ããŸããMuleSoft Composer ã§æ¥ç¶ãèªåçã«ãã¹ããããŸãããšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŠããªãå Žåã¯æ¥ç¶ã確ç«ããããããŒã® 2 çªç®ã®ã¹ãããã衚瀺ãããŸãã
ããªã¬ãŒååŒå 責任è ãšäžèŽãã顧客ãæ€çŽ¢ãã 2 çªç®ã®ã¹ããããèšå®ããŸãã
- [Action (ã¢ã¯ã·ã§ã³)] é ç®ã§ã[Request (èŠæ±)] ãéžæããŸãã
- [HTTP method (HTTP ã¡ãœãã)] é ç®ã§ã[POST] ãéžæããŸãã
- [Path (ãã¹)] é
ç®ã«ã
/v2/customers/search
ãšå ¥åããŸãã - [Edit Example Request (èŠæ±äŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®èŠæ±ã¯ã[Search customers (顧客ã®æ€çŽ¢)] (POST) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããèŠæ±ã«äŒŒãŠããŸãã
{ Â Â Â Â "query": { Â Â Â Â Â Â "filter": { Â Â Â Â Â Â Â Â "email_address": { Â Â Â Â Â Â Â Â Â Â "exact": "max.mule@mulesoft.com" Â Â Â Â Â Â Â Â } Â Â Â Â Â Â } Â Â Â Â }, Â Â Â Â "limit": 1 }
- [Select Optional Fields (çç¥å¯èœãªé ç®ãéžæ)] ãã¯ãªãã¯ããŸãã
- [Exact (å®å š)] ãã¯ãªãã¯ãã[Apply (é©çš)] ãã¯ãªãã¯ããŸãã[Body (æ¬æ)] ã»ã¯ã·ã§ã³ã« [Exact (å®å š)] é ç®ã衚瀺ããããããŒã®ã¹ããã 1 ã® [Email (ã¡ãŒã«)] é ç®ã«èªåçã«å¯Ÿå¿ä»ããããŸãã
- [Edit Example Response(å¿çäŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®å¿çã¯ã[Search customers (顧客ã®æ€çŽ¢)] (POST) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããå¿çã«äŒŒãŠããŸãããã®å¿çã¯é¡§å®¢ãªã¹ããè¿ããŸãããã®ããã次㫠For Each ãããã¯ã䜿çšããŠã顧客ã®ãªã¹ããå埩åŠçããå¿
èŠããããŸãã
{   "customers": [     {       "id": "C36YN1H364V79CJ6JAPRRV9FRM",       "created_at": "2022-05-27T17:47:08.613Z",       "updated_at": "2022-05-27T17:47:48Z",       "given_name": "Max",       "family_name": "Mule",       "email_address": "max.mule@mulesoft.com",       "address": {         "address_line_1": "415 Mission Ave",         "locality": "San Francisco",         "administrative_district_level_1": "CA",         "postal_code": "94105",         "country": "US"       },       "phone_number": "1-800-664-9073",       "reference_id": "0031U000023vRPcQAM",       "preferences": {         "email_unsubscribed": false       },       "creation_source": "THIRD_PARTY",       "version": 1     }   ] }
ãããŒã®ã¹ããã 2 ã®é¡§å®¢ãªã¹ãã®å顧客ãå埩åŠçãã For Each ãããã¯ãäœæããŠèšå®ããŸãã
- ãã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ããŠã¹ããããè¿œå ããŸãã
- ã¹ã¯ããŒã«ããŠã³ã㊠[For Each] ãéžæããŸãã
- [Input list (å ¥åãªã¹ã)] é ç®ã§ããããŒã®ã¹ããã 2 ã® [List of Customers (顧客ã®ãªã¹ã)] ãéžæããŸãã
For Each ãããã¯å ã§ãããªã¬ãŒååŒå 責任è ã«å¯Ÿå¿ãã顧客ããããã©ãããå€æãã If/Else ãããã¯ãäœæããŠèšå®ããŸãããã® If/Else ãããã¯ã§ã¯ãå®è¡æã«ç¡éã«ãŒãã«é¥ãåé¡ãçºçããªãããšãä¿èšŒããããã«ãæŽæ°ãå®è¡ããŠãããŠãŒã¶ãŒãã³ã³ããŒã¶ãŒãŠãŒã¶ãŒã§ãªããã©ãããè©äŸ¡ããŸããÂ
- ãã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ã㊠For Each ãããã¯å ã«ã¹ããããè¿œå ããŸãã
- ã¹ã¯ããŒã«ããŠã³ã㊠[If/Else Block (If/Else ãããã¯)] ãã¯ãªãã¯ããŸããããã©ã«ã㧠[All conditions must be met (AND) (ãã¹ãŠã®æ¡ä»¶ãæºããå¿ èŠããã (AND))] ãéžæãããŠããŸãã
- é ç®ã«ãããŒã®ã¹ããã 2 ã® [Customers (顧客)] ãéžæããæŒç®åã« [Is not empty (空ã§ãªã)] ãéžæããŸãããã®æ¡ä»¶ãæºãããå Žåã¯ãååŒå 責任è ã«å¯Ÿå¿ãã顧客ãããŸãã
- [Add a condition (æ¡ä»¶ãè¿œå )] ãã¯ãªãã¯ããŸãã
- é ç®ãšããŠãããŒã®ã¹ããã 1 ã® [Last Modified by Id (æçµæŽæ°è Id)]ãæŒç®åãšã㊠[Does not equal (次ã®æååãšäžèŽããªã)] ãéžæããŠãåå 1 ã§èŠã€ããã³ã³ããŒã¶ãŒãŠãŒã¶ãŒã® Salesforce ID ãå ¥åããŸãããã®äŸã§ã¯ 0051U0000026WFLQA2 ã§ãããã®æ¡ä»¶ã«äžèŽããå ŽåãæŽæ°ãå®è¡ããŠãããŠãŒã¶ãŒã¯ã³ã³ããŒã¶ãŒãŠãŒã¶ãŒã§ã¯ãªããšã³ããŠãŒã¶ãŒã§ããäž¡æ¹ã®æ¡ä»¶ãæºãããå Žåã¯ãIf ãã©ã³ãã®åŸç¶ã® 2 ã€ã®ã¹ããã (Square 顧客ã®æŽæ°ãNTO ååŒå 責任è ã®æŽæ°) ãå®è¡ãããŸãã
æ¢åã® NTO Square Sandbox æ¥ç¶ã䜿çšã㊠If/Else ãããã¯ã® If ãã©ã³ãå ã«ãããŒã® 3 çªç®ã®ã¹ããããäœæããŸãã
- ãã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ã㊠If ãã©ã³ãã«ã¹ããããè¿œå ããŸãã
-
[HTTP] ãã¯ãªãã¯ãã[NTO Square sandbox] ãã¯ãªãã¯ããŸãã
ã¡ã¢: æ¢åã® NTO Square Sandbox æ¥ç¶ãåå©çšããŸãã
é©åãªååŒå 責任è ã®è©³çŽ° (é¢é£ä»ããããååŒå 責任è ID ãªã©) ã䜿çšããŠé¡§å®¢ãæŽæ°ãã 3 çªç®ã®ã¹ããããèšå®ããŸãã
- [Action (ã¢ã¯ã·ã§ã³)] é ç®ã§ã[Request (èŠæ±)] ãéžæããŸãã
- [HTTP method (HTTP ã¡ãœãã)] é ç®ã§ã[PUT] ãéžæããŸãã
- [Path (ãã¹)] é ç®ãã¯ãªãã¯ãã[Custom Expression (ã«ã¹ã¿ã åŒ)] ãã¯ãªãã¯ããŸããã«ã¹ã¿ã åŒãšãã£ã¿ãŒã衚瀺ãããŸãããã®ã«ã¹ã¿ã åŒãšãã£ã¿ãŒã䜿çšããŠããããŒã®åã®ã¹ãããããã®åçãªé ç®å€ (ããŒã¿ãã«ãšãåŒã°ããŸã) ãšãŠãŒã¶ãŒãå ¥åããéçãªããã¹ãã®äž¡æ¹ãå«ãã¡ãã»ãŒãžãèšå®ããŸãã
-
/v2/customers/
ãšå ¥åãã[Data (ããŒã¿)] ã¿ããã¯ãªãã¯ããŠããããŒã®ã¹ããã 2 ã® [Customers (顧客)] > [Id] ãéžæããŸãã - [Apply (é©çš)] ãã¯ãªãã¯ããŸãã
- [Edit Example Request (èŠæ±äŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®èŠæ±ã¯ã[Update customer (顧客ã®æŽæ°)] (PUT) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããèŠæ±ã«äŒŒãŠããŸãã
{ Â Â Â Â "given_name": "Jane", Â Â Â Â "family_name": "Doe", Â Â Â Â "email_address": "Jane.Doe@example.com", Â Â Â Â "address": { Â Â Â Â Â Â "address_line_1": "500 Electric Ave", Â Â Â Â Â Â "address_line_2": "Suite 600", Â Â Â Â Â Â "locality": "New York", Â Â Â Â Â Â "administrative_district_level_1": "NY", Â Â Â Â Â Â "postal_code": "10003", Â Â Â Â Â Â "country": "US" Â Â Â Â }, Â Â Â Â "phone_number": "1-212-555-4240", Â Â Â Â "reference_id": "salesforce_id"Â Â }
- [Add Fields (é ç®ãè¿œå )] ãã¯ãªãã¯ããŸãã
- æ€çŽ¢é
ç®ã䜿çšããŠã次ã®é
ç®ãèŠã€ããŠéžæãã[Add (è¿œå )] ãã¯ãªãã¯ããŸãã
ãã³ã: æ€çŽ¢ããé ç®ã®ããŒã¯ãŒããå ¥åãã衚瀺ãããé ç®ã®äžããé©åãªãã®ãéžæããŸããããŒã¯ãŒããã¯ãªã¢ããŠã次ã®é ç®ã§ãã®ããã»ã¹ãç¹°ãè¿ããŸãããã¹ãŠã®é ç®ãéžæãããã[Add (è¿œå )] ãã¯ãªãã¯ããŸãã- Email_address
- Family_name
- Given_name
- Phone_number
- Reference_id
- Address_line_1
- Administrative_district_level_1
- Country
- Locality
- Postal_code
- 顧客é
ç®ãããããŒã®ã¹ããã 1 ã§ååŸããååŒå
責任è
ã®å¯Ÿå¿ããé
ç®ã«æ¬¡ã®ããã«å¯Ÿå¿ä»ããŸãã
- Email_address = Email (ã¡ãŒã«)
- Family_name = Last Name (å§)
- Given_name = First Name (å)
- Phone_number = Business Phone (äŒç€Ÿé»è©±)
- Reference_id = Contact ID (ååŒå 責任è ID)
- äœæ
- Address_line_1 = Mailing Address (äœæ(éµéå )) > Street (çºåã»çªå°)
- Administrative_district_level_1 = Mailing Address (äœæ(éµéå ))> State (éœéåºç)
- Country = Mailing Address (äœæ(éµéå )) > Country (åœ)
- Locality = Mailing Address (äœæ(éµéå )) > City (åžåºé¡)
- Postal_code = Mailing Address (äœæ(éµéå )) > Postal Code (éµäŸ¿çªå·)
- [Edit Example Response(å¿çäŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®å¿çã¯ã[Update customer (顧客ã®æŽæ°)] (PUT) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããå¿çã«äŒŒãŠããŸãã
{   "customer": {     "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",     "created_at": "2016-03-23T20:21:54.859Z",     "updated_at": "2016-03-23T20:21:54.859Z",     "given_name": "Jane",     "family_name": "Doe",     "email_address": "Jane.Doe@example.com",     "address": {       "address_line_1": "500 Electric Ave",       "address_line_2": "Suite 600",       "locality": "New York",       "administrative_district_level_1": "NY",       "postal_code": "10003",       "country": "US"     },     "phone_number": "1-212-555-4240",     "reference_id": "YOUR_REFERENCE_ID",     "note": "a customer",     "preferences": {       "email_unsubscribed": false     },     "creation_source": "THIRD_PARTY",     "group_ids": [       "545AXB44B4XXWMVQ4W8SBT3HHF"     ],     "segment_ids": [       "1KB9JE5EGJXCW.REACHABLE"     ],     "version": 1   } }
æ¢åã® NTO Sandbox çµç¹ã®æ¥ç¶ã䜿çšã㊠If ãã©ã³ãå ã«ãããŒã® 4 çªç®ã®ã¹ããããäœæããŸãã
- ãã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ã㊠If ãã©ã³ãå ã«ã¹ããããè¿œå ããŸãã
-
[Salesforce] ãã¯ãªãã¯ãã[NTO sandbox org (NTO Sandbox çµç¹)] ãã¯ãªãã¯ããŸãã
ã¡ã¢: æ¢åã® NTO Sandbox çµç¹ã®æ¥ç¶ãåå©çšããŸãã
é¢é£ä»ãããã顧客 ID ã䜿çšããŠããªã¬ãŒååŒå 責任è ãæŽæ°ãã 4 çªç®ã®ã¹ããããèšå®ããŸãã
- [Action (ã¢ã¯ã·ã§ã³)] é ç®ãã¯ãªãã¯ããŠã[Update Record (ã¬ã³ãŒããæŽæ°)] ãéžæããŸãã
- [Object Type (ãªããžã§ã¯ãçš®å¥)] é
ç®ã«ã
Contact
(ååŒå 責任è ) ãšå ¥åããŸãã[Contact ID (ååŒå 責任è ID)] ã¯å¿ é é ç®ã®ãããèªåçã«éžæãããŸãã - [Add Fields (é ç®ãè¿œå )] ãã¯ãªãã¯ããŸãã
- æ€çŽ¢ããŒã«ã䜿çšã㊠[Square Customer ID (Square 顧客 ID)] ãéžæãã[Add (è¿œå )] ãã¯ãªãã¯ããŸãã
- ååŒå 責任è ã®é ç®ãããããŒã®å è¡ããã¹ãããã§ååŸãã察å¿ããé ç®ã«æ¬¡ã®ããã«å¯Ÿå¿ä»ããŸãã
- Contact ID (ååŒå 責任è ID) = ã¹ããã 1 ã® [Contact ID (ååŒå 責任è ID)]
- Square Customer ID (Square 顧客 ID) = ã¹ããã 2 ã® [Customers (顧客)] > [Id]
For Each ãããã¯ã®å€ã§ã察å¿ãã顧客ããªãååŒå 責任è ãåŠçãã 2 çªç®ã® If/Else ãããã¯ãäœæããŠèšå®ããŸãã
- ãããŒã®äžçªäžã® For Each ãããã¯ã®å€ã«ãããã©ã¹ã¢ã€ã³ã³ãã¯ãªãã¯ããŠã¹ããããè¿œå ããŸãã
- ã¹ã¯ããŒã«ããŠã³ã㊠[If/Else Block (If/Else ãããã¯)] ãã¯ãªãã¯ããŸããããã©ã«ã㧠[All conditions must be met (AND) (ãã¹ãŠã®æ¡ä»¶ãæºããå¿ èŠããã (AND))] ãéžæãããŠããŸãã
- é ç®ã«ãããŒã®ã¹ããã 2 ã® [Customers (顧客)] ãéžæããæŒç®åã« [Is empty (空)] ãéžæããŸãããã®æ¡ä»¶ãæºãããå Žåã¯ãååŒå 責任è ã«å¯Ÿå¿ãã顧客ãããŸããã
ãããŒã®ã¹ããã 3 ãè€è£œã㊠If ãã©ã³ãå ã«ãããŒã® 5 çªç®ã®ã¹ããããäœæããŸãã
- ãããŒã®ã¹ããã 3 ãŸã§ã¹ã¯ããŒã«ããã¹ãããã®çç¥èšå·ãã¿ã³ãã¯ãªãã¯ãã[Duplicate Step (ã¹ããããè€è£œ)] ãã¯ãªãã¯ããŸãããããŒã®ã¹ããã 4 ãäœæãããŸãã
- ã¹ããã 4 ã® [Move Step (ã¹ãããã移å)] (4 æ¹åç¢å°) ãã¿ã³ãã¯ãªãã¯ããŸãã[Move Step (ã¹ãããã移å)] ãŠã£ã³ããŠãéãããããŒã®ã¹ãããã®ãªã¹ãã衚瀺ãããŸãã[Move Step (ã¹ãããã移å)] éžæãªã¹ãã¯ããã©ã«ã㧠[After (åŸ)] ã«èšå®ãããŠããŸãã
- å¿ èŠã«å¿ããŠãå³ç¢å°ã䜿çšããŠãIf/Else ãããã¯ãå±éããŸãã
- [Customers is empty (顧客 空)] (ãã©ã³ã 1) ãå±éããŸãã
- [Move inside Customers is empty (Branch 1) (顧客 空 (ãã©ã³ã 1) ã®å éšã«ç§»å)] ãã¯ãªãã¯ãã[Move (移å)] ãã¯ãªãã¯ããŸããã¹ããã 4 ã 2 çªç®ã® If ãã©ã³ãã«ç§»åãããããŒã®ã¹ããã 5 ã«ãªããŸãã
é©åãªååŒå 責任è ã®è©³çŽ° (é¢é£ä»ããããååŒå 責任è ID ãªã©) ã䜿çšããŠé¡§å®¢ãäœæãã 5 çªç®ã®ã¹ããããèšå®ããŸãã
- ãããŒã®ã¹ããã 5 ãŸã§ã¹ã¯ããŒã«ããŠã³ããŸãã[Action (ã¢ã¯ã·ã§ã³)] é ç®ã¯ [Request (èŠæ±)] ã«èšå®ããããŸãŸã§ãã
- [HTTP method (HTTP ã¡ãœãã)] é ç®ã§ã[POST] ãéžæããŸãã
- [Path (ãã¹)] é
ç®ãã
/v2/customers
ã«å€æŽããŸãã - [Edit Example Request (èŠæ±äŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®èŠæ±ã¯ã[Create customer (顧客ã®äœæ)] (POST) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããèŠæ±ã«äŒŒãŠããŸãã
{ Â Â Â Â "given_name": "Jane", Â Â Â Â "family_name": "Doe", Â Â Â Â "email_address": "Jane.Doe@example.com", Â Â Â Â "address": { Â Â Â Â Â Â "address_line_1": "500 Electric Ave", Â Â Â Â Â Â "address_line_2": "Suite 600", Â Â Â Â Â Â "locality": "New York", Â Â Â Â Â Â "administrative_district_level_1": "NY", Â Â Â Â Â Â "postal_code": "10003", Â Â Â Â Â Â "country": "US" Â Â Â Â }, Â Â Â Â "phone_number": "1-212-555-4240", Â Â Â Â "reference_id": "salesforce_id"Â }
- 顧客é
ç®ããããŒã®ã¹ããã 1 ã§ååŸããååŒå
責任è
ã®å¯Ÿå¿ããé
ç®ã«æ¬¡ã®ããã«ããããããŠããããšã確èªããŸãã
- Email_address = Email (ã¡ãŒã«)
- Family_name = Last Name (å§)
- Given_name = First Name (å)
- Phone_number = Business Phone (äŒç€Ÿé»è©±)
- Reference_id = Contact ID (ååŒå 責任è ID)
- äœæ
- Address_line_1 = Mailing Address (äœæ(éµéå )) > Street (çºåã»çªå°)
- Administrative_district_level_1 = Mailing Address (äœæ(éµéå ))> State (éœéåºç)
- Country = Mailing Address (äœæ(éµéå )) > Country (åœ)
- Locality = Mailing Address (äœæ(éµéå )) > City (åžåºé¡)
- Postal_code = Mailing Address (äœæ(éµéå )) > Postal Code (éµäŸ¿çªå·)
- [Edit Example Response(å¿çäŸãç·šé)] ãã¯ãªãã¯ããŸãã
- 次ã®ã³ãŒããã³ããŒããŠè²Œãä»ãã[Save (ä¿å)] ãã¯ãªãã¯ããŸãããã®å¿çã¯ã[Create customer (顧客ã®äœæ)] (POST) ãšã³ããã€ã³ãã䜿çšãããŠããå Žåã« API Explorer ããŒã«ã§çæãããå¿çã«äŒŒãŠããŸãã
{   "customer": {     "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",     "created_at": "2016-03-23T20:21:54.859Z",     "updated_at": "2016-03-23T20:21:54.859Z",     "given_name": "Jane",     "family_name": "Doe",     "email_address": "Jane.Doe@example.com",     "address": {       "address_line_1": "500 Electric Ave",       "address_line_2": "Suite 600",       "locality": "New York",       "administrative_district_level_1": "NY",       "postal_code": "10003",       "country": "US"     },     "phone_number": "1-212-555-4240",     "reference_id": "YOUR_REFERENCE_ID",     "note": "a customer",     "preferences": {       "email_unsubscribed": false     },     "creation_source": "THIRD_PARTY",     "group_ids": [       "545AXB44B4XXWMVQ4W8SBT3HHF"     ],     "segment_ids": [       "1KB9JE5EGJXCW.REACHABLE"     ],     "version": 1   } }
ãããŒã®ã¹ããã 4 ãè€è£œã㊠If ãã©ã³ãå ã«ãããŒã® 6 çªç®ã®ã¹ããããäœæããŸãã
- ãããŒã®ã¹ããã 4 ãŸã§ã¹ã¯ããŒã«ããã¹ãããã®çç¥èšå·ãã¿ã³ãã¯ãªãã¯ãã[Duplicate Step (ã¹ããããè€è£œ)] ãã¯ãªãã¯ããŸãããããŒã®ã¹ããã 5 ãäœæãããŸãã
- ã¹ããã 5 ã® [Move Step (ã¹ãããã移å)] (4 æ¹åç¢å°) ãã¿ã³ãã¯ãªãã¯ããŸãã[Move Step (ã¹ãããã移å)] ãŠã£ã³ããŠãéãããããŒã®ã¹ãããã®ãªã¹ãã衚瀺ãããŸãã[Move Step (ã¹ãããã移å)] éžæãªã¹ãã¯ããã©ã«ã㧠[After (åŸ)] ã«èšå®ãããŠããŸãã
- If/Else ãããã¯ãå±éããŸãã
- [Customers is empty (顧客 空)] (ãã©ã³ã 1) ãå±éããŸãã
- [6. Action: Request in HTTP (6. ã¢ã¯ã·ã§ã³: HTTP ã§èŠæ±)] ãã¯ãªãã¯ãã[Move (移å)] ãã¯ãªãã¯ããŸããã¹ããã 5 ã 2 çªç®ã® If ãã©ã³ãã«ç§»åãããããŒã®ã¹ããã 6 ã«ãªããŸãã
é¢é£ä»ãããã顧客 ID ã䜿çšããŠããªã¬ãŒååŒå 責任è ãæŽæ°ãã 6 çªç®ã®ã¹ããããèšå®ããŸãã
- ãããŒã®ã¹ããã 6 ãŸã§ã¹ã¯ããŒã«ããŠã³ããŸãã[Action (ã¢ã¯ã·ã§ã³)] é ç®ã¯ [Update record (ã¬ã³ãŒããæŽæ°)] ã«èšå®ããããŸãŸã§ã[Object Type (ãªããžã§ã¯ãçš®å¥)] é ç®ã¯ [Contact (ååŒå 責任è )] ã«èšå®ããããŸãŸã§ãã
- ååŒå
責任è
ã®é
ç®ããããŒã®å
è¡ããã¹ãããã§ååŸãã察å¿ããé
ç®ã«æ¬¡ã®ããã«ããããããŠããããšã確èªããŸãã
- Contact ID (ååŒå 責任è ID) = ã¹ããã 1 ã® [Contact ID (ååŒå 責任è ID)]
- Square Customer ID (Square 顧客 ID) = ã¹ããã 5 ã® [Customer (顧客)] > [Id]
- ãããŒãä¿åããŸãããããŒå
šäœã¯æ¬¡ã®ããã«ãªããŸãã
ãç²ãããŸã§ããã次ã®åå ã§ã¯ããããŒããã¹ãããŠæ£åžžã«æ©èœããããšã確èªããæ¹æ³ãåŠç¿ããŸãã