主页 > marketing >
使用 postman 创建 Marketing Cloud 的 Contact(postman创建项目)
25-04-26
1
如果您对使用postman创建MarketingCloud的Contact和postman创建项目感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解使用postman创建MarketingClou
如果您对使用 postman 创建 Marketing Cloud 的 Contact 和postman创建项目 感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解使用 postman 创建 Marketing Cloud 的 Contact 的各种细节,并对postman创建项目 进行深入的分析,此外还有关于Cloud for Customer 的 contact 主数据 function 字段下拉菜单的绘制原理、Contact Form 7 添加检查验证表单步骤插件 – Contact Form 7 add confirm、Django/Python“django.core.exceptions.ImproperlyConfigured:无法导入‘contact’检查‘...apps.contact.apps.ContactConfig.name’是否正确”、Facebook Graph & Marketing APIs - Postman 集合可用? 的实用技巧。
本文目录一览:
使用 postman 创建 Marketing Cloud 的 Contact(postman创建项目)
首先在 Marketing Cloud 的 UI 上创建一个 contact:
观察 Chrome 开发者工具 network 标签页里的 HTTP 请求:
https://jerry.gcdemo.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/?sap-client=100
这个请求用于读取 CSRF token:
点击保存,会发送一个新的 HTTP post 请求:
请求 url: https://jerry.hybris.com/sap/opu/odata/sap/CUAN_COMMON_SRV/ContactPersons?sap-client=100 再看下重要的请求头部字段:
把第一步获得的 CSRF token 填到 Postman 里的 header 字段里,如图:
body:
{"CountryCode" :"CN" ,"City" :"Chengdu" ,"FirstName" :"Jerry1" ,"LastName" :"Wang1" ,"PostalCode" :"610093" ,"RegionCode" :"" ,"Street" :"天府软件园" ,"HouseNumber" :"天府软件园" ,"DateofBirth" :null ,"ContactPersonFacets" :[{"Id" :"jerry1@sap.com" ,"IdOrigin" :"EMAIL" ,"Obsolete" :false ,"Invalid" :false },{"Id" :"" ,"IdOrigin" :"PHONE" ,"Obsolete" :false ,"Invalid" :false },{"Id" :"" ,"IdOrigin" :"MOBILE" ,"Obsolete" :false ,"Invalid" :false },{"Id" :"" ,"IdOrigin" :"FAX" ,"Obsolete" :false ,"Invalid" :false }],"IsConsumer" :true ,"Filter" :{"MarketingAreaId" :"CXXGLOBAL" }}
状态码 201,证明创建成功了:
可以在前端看到创建成功的 contact:
要获取更多 Jerry 的原创文章,请关注公众号 "汪子熙":
本文同步分享在 博客 “汪子熙”(CSDN)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与 “OSC 源创计划”,欢迎正在阅读的你也加入,一起分享。
[外链图片转存失败 (img-kY00ou5p-1566695062000)(https://upload-images.jianshu.io/upload_images/2085791-dcc88e58a67cac8c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)] 要获取更多 Jerry 的原创文章,请关注公众号 "汪子熙":
本文同步分享在 博客 “汪子熙”(CSDN)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与 “OSC 源创计划”,欢迎正在阅读的你也加入,一起分享。
站长朋友们在使用以后,为了访客能够轻松联系到自己,提高网站的转化率,通常会在网站中加入联系我们的表单,让客户可以方便的在线发邮件给自己预设的邮箱。我们都熟悉,这种表单使用 来做非常方便,但是Contact Form 7插件默认的工作流程是:客户填写咨询信息,点击发送,直接发到站长的邮箱,并没有检查确认的步骤。今天我们就来介绍一款插件 – Contact Form 7 add confirm,这款wordpress插件可以给 Contact Form 7 添加检查验证表单的步骤。
插件安装方法:
1. 在后台的插件里搜索 Contact Form 7 add confirm,在线安装或者,上传到服务器空间。 2. 激活插件。
插件使用方法: 通常提交按钮的代码是:
如何解决Django/Python“django.core.exceptions.ImproperlyConfigured:无法导入‘contact’检查‘...apps.contact.apps.ContactConfig.name’是否正确” 希望大家能帮我解决这个问题...
我的工作流程:
|. vscode :
| capstone_project_website :
| - _pycache_ :
| - apps :
| - _pycache_
| - accounts :
| - contact : # app that is throwing errors
| - _pycache_ :
| - migrations :
| - _init_ . py
| - admin . py
| - apps . py
| - forms . py
| - models . py
| - test . py
| - urls . py
| - views . py
| - public :
| - _init_ . py
| - templates : # all my .html
| - _init_ . py
| - a sgi . py
| - settings . py
| - urls . py
| - views . py
| - w sgi . py
| requirements :
| scripts :
| static :
|. gitig nor e
|. python - version
| db - sqlite3
| docker - compose . yml
| Dockerfile
| Makefile #command I am running
| manage . py
| setup . cfg
我在 capstone_project_website/settings.py
中安装的应用程序:
INSTALLED_APPS = [
"django.contrib.admin" , "django.contrib.auth" , "django.contrib.contenttypes" , "django.contrib.sessions" , "django.contrib.messages" , "django.contrib.staticfiles" , "capstone_project_website.apps.accounts" , "capstone_project_website.apps.contact" ,]
我的capstone_project_website/apps/contact/apps.py
:
from django . apps import AppCon fig
class ContactCon fig ( AppCon fig ):
name = "contact"
我正在运行的命令在我的 Makefile
中:
compose - start :
docker - compose up -- remove - orphans $ ( options )
当我运行 make compose-start
时,我从我的终端收到此消息:
make compose - start
docker - compose up -- remove - orphans
Docker Compose is Now in the Docker CLI , try `docker compose up`
Starting django - website_postgres_1 ... done
Starting django - website_db_migrate_1 ... done
Starting django - website_website_1 ... done
Attaching to django - website_postgres_1 , django - website_db_migrate_1 , django - website_website_1
db_migrate_1 | Traceback ( most recent call last ):
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/apps/con fig .py" , line 244 , in create
db_migrate_1 | app_module = import_module ( app_name )
db_migrate_1 | File "/usr/local/lib/ python3.7 /importlib/ __init__ .py" , line 127 , in import_module
db_migrate_1 | return _bootstrap . _gcd_import ( name [ level :], package , level )
db_migrate_1 | File "<frozen importlib._bootstrap>" , line 1006 , in _gcd_import
db_migrate_1 | File "<frozen importlib._bootstrap>" , line 983 , in _find_and_load
db_migrate_1 | File "<frozen importlib._bootstrap>" , line 965 , in _find_and_load_unlocked
db_migrate_1 | ModuleNotFoundError : No module named ''contact''
db_migrate_1 |
db_migrate_1 | During handling of the above exception , another exception occurred :
db_migrate_1 |
db_migrate_1 | Traceback ( most recent call last ):
db_migrate_1 | File "manage.py" , line 22 , in <module>
db_migrate_1 | main ()
db_migrate_1 | File "manage.py" , line 18 , in main
db_migrate_1 | execute_from_command_line ( sys . argv )
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/core/management/ __init__ .py" , line 419 , in execute_from_command_line
db_migrate_1 | utility . execute ()
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/core/management/ __init__ .py" , line 395 , in execute
db_migrate_1 | django . setup ()
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/ __init__ .py" , line 24 , in setup
db_migrate_1 | apps . populate ( settings . INSTALLED_APPS )
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/apps/registry.py" , line 91 , in populate
db_migrate_1 | app_con fig = AppCon fig . create ( entry )
db_migrate_1 | File "/usr/local/lib/ python3.7 /site-packages/django/apps/con fig .py" , line 250 , in create
db_migrate_1 | app_con fig _class . __qualname__ , db_migrate_1 | django . core . exceptions . ImproperlyCon fig ured : Cannot import ''contact'' . Check that ''capstone_project_website.apps.contact.apps.ContactCon fig .name'' is correct .
postgres_1 |
postgres_1 | Postgre sql Database directory appears to contain a database ; Skipping initialization
postgres_1 |
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.105 UTC [ 1 ] LOG : starting Postgre sql 13.2 ( Debian 13.2 - 1.pgdg100 + 1 ) on x86_64 - pc - linux - gnu , compiled by gcc ( Debian 8.3 . 0 - 6 ) 8.3 . 0 , 64 - bit
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.106 UTC [ 1 ] LOG : listening on IPv4 address "0.0.0.0" , port 5432
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.106 UTC [ 1 ] LOG : listening on IPv6 address "::" , port 5432
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.113 UTC [ 1 ] LOG : listening on Unix socket "/var/run/postgre sql /.s.PG sql .5432"
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.121 UTC [ 28 ] LOG : database sy stem was shut down at 2021 - 05 - 02 14 : 17 : 17 UTC
django - website_db_migrate_1 exited with code 1
postgres_1 | 2021 - 05 - 02 14 : 17 : 44.129 UTC [ 1 ] LOG : database sy stem is ready to accept connections
website_1 | Watching for file changes with StatReloader
^ CGracefully stopping ... ( press Ctrl + C again to force )
Stopping django - website_website_1 ... done
Stopping django - website_postgres_1 ... done
我知道我投入了很多工作流程,但我想知道我是否设置错误。我之前在我的帐户应用程序上尝试 makemigrations
时遇到过这个问题。那个答案似乎奏效了。
答案是将 name
中的 capstone_project_website/apps/accounts/apps.py
更改为
class AccountsCon fig ( AppCon fig ):
name = "capstone_project_website.apps.accounts"
在已安装的应用程序中,您可以看到路径是:
"capstone_project_website.apps.accounts" ,
我已尝试更改...的名称capstone_project_website/apps/contact/apps.py
class ContactCon fig ( AppCon fig ):
name = "contact"
...到name=''capstone_project_website.apps.contact''
...和我安装的应用名称:
INSTALLED_APPS = [
...
"capstone_project_website.apps.ContactCon fig " ,]
重点是我不确定发生了什么,是目录问题、名称问题还是在make compose-start
之前遗漏了某些步骤。如果您能帮我解决这个问题,并解释我做错了什么,我将不胜感激!
谢谢
解决方法
检查您的 Django 版本。如果您将 django 版本更新到 3.2 ,请尝试切换到最早的版本。
django==3.1.8
,
尝试改变这个:
类 ContactConfig(AppConfig):
姓名 = "联系人"
为此:
类 ContactConfig(AppConfig):
name = "apps.contact"
Facebook Graph & Marketing APIs - Postman 集合可用? 如何解决Facebook Graph & Marketing APIs - Postman 集合可用?
是否有任何 Postman 集合可用于 Facebook Graph API 及其“子项”? (营销 API 和朋友。)
我肯定会在他们的 SDK Github 页面上的某个地方询问,但他们都不允许发布任何“问题”。另外,我已经在网上冲浪了一段时间。
我所追求的一个很好的例子是 WhatsApp 的 Business API Postman 集合,它在这里公开 -> https://developers.facebook.com/docs/whatsapp/guides/postman/
解决方法
您要查找的内容目前不可用。
我们的文档是所有 API 的真实来源
https://developers.facebook.com/docs/
今天关于使用 postman 创建 Marketing Cloud 的 Contact 和postman创建项目 的讲解已经结束,谢谢您的阅读,如果想了解更多关于Cloud for Customer 的 contact 主数据 function 字段下拉菜单的绘制原理、Contact Form 7 添加检查验证表单步骤插件 – Contact Form 7 add confirm、Django/Python“django.core.exceptions.ImproperlyConfigured:无法导入‘contact’检查‘...apps.contact.apps.ContactConfig.name’是否正确”、Facebook Graph & Marketing APIs - Postman 集合可用? 的相关知识,请在本站搜索。