Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services 从API创建新客户并不意味着';t设置关联组id_Web Services_Prestashop - Fatal编程技术网

Web services 从API创建新客户并不意味着';t设置关联组id

Web services 从API创建新客户并不意味着';t设置关联组id,web-services,prestashop,Web Services,Prestashop,我正在尝试使用Postman上的prestashop Web服务创建一个新客户。我已经更新了webservice以接受输入和输出的json格式。当我尝试创建新客户时,数据库中添加了一行,但未添加关联组id 我得到了空白的资源,在这里我得到了: { "customer": { "id_default_group": "", "id_lang": "", "newsletter_date_add": "", "ip_registration_newsletter":

我正在尝试使用Postman上的prestashop Web服务创建一个新客户。我已经更新了webservice以接受输入和输出的json格式。当我尝试创建新客户时,数据库中添加了一行,但未添加关联组id

我得到了空白的资源,在这里我得到了:

{
"customer": {
    "id_default_group": "",
    "id_lang": "",
    "newsletter_date_add": "",
    "ip_registration_newsletter": "",
    "last_passwd_gen": "",
    "secure_key": "",
    "deleted": "",
    "passwd": "",
    "lastname": "",
    "firstname": "",
    "email": "",
    "id_gender": "",
    "birthday": "",
    "newsletter": "",
    "optin": "",
    "website": "",
    "company": "",
    "siret": "",
    "ape": "",
    "outstanding_allow_amount": "",
    "show_public_prices": "",
    "id_risk": "",
    "max_payment_days": "",
    "active": "",
    "note": "",
    "is_guest": "",
    "id_shop": "",
    "id_shop_group": "",
    "date_add": "",
    "date_upd": "",
    "reset_password_token": "",
    "reset_password_validity": "",
    "associations": {
        "groups": [
            {
                "id": null
            }
        ]
    }
}
}
以下是我填写表格的方式:

{
"customer": {
    "id_default_group": "3",
    "id_lang": "1",
    "newsletter_date_add": "0000-00-00 00:00:00",
    "ip_registration_newsletter": "",
    "last_passwd_gen": "",
    "secure_key": "",
    "deleted": "0",
    "passwd": "20101998",
    "lastname": "sign up",
    "firstname": "test",
    "email": "asdfgh@gmail.com",
    "id_gender": "2",
    "birthday": "0000-00-00",
    "newsletter": "0",
    "optin": "0",
    "website": "",
    "company": "",
    "siret": "",
    "ape": "",
    "outstanding_allow_amount": "0.000000",
    "show_public_prices": "0",
    "id_risk": "0",
    "max_payment_days": "0",
    "active": "1",
    "note": "",
    "is_guest": "0",
    "id_shop": "1",
    "id_shop_group": "1",
    "date_add": "",
    "date_upd": "",
    "reset_password_token": "",
    "reset_password_validity": "0000-00-00 00:00:00",
    "associations": {
        "groups": [
            {
                "id": "3"
            }
        ]
    }
}
}
结果如下:

{
"customers": [
    {
        "id": "41",
        "id_default_group": 3,
        "id_lang": "1",
        "newsletter_date_add": "0000-00-00 00:00:00",
        "ip_registration_newsletter": "",
        "last_passwd_gen": "2019-11-08 09:24:55",
        "secure_key": "c8aa63435abbd3282b22080c903091e4",
        "deleted": "0",
        "passwd": "$2y$10$mt4u0xuPadIRVsV267Ao8uTGEPU.vixzNMRAfX5P.WY2OJClpBHsW",
        "lastname": "sign up",
        "firstname": "test",
        "email": "asdfgh@gmail.com",
        "id_gender": "2",
        "birthday": "0000-00-00",
        "newsletter": "0",
        "optin": "0",
        "website": "",
        "company": "",
        "siret": "",
        "ape": "",
        "outstanding_allow_amount": "0.000000",
        "show_public_prices": "0",
        "id_risk": "0",
        "max_payment_days": "0",
        "active": "1",
        "note": "",
        "is_guest": "0",
        "id_shop": "1",
        "id_shop_group": "1",
        "date_add": "2019-11-08 15:24:55",
        "date_upd": "2019-11-08 15:24:55",
        "reset_password_token": "",
        "reset_password_validity": "0000-00-00 00:00:00"
    }
]
}
您可以看到没有关联返回


谁能告诉我我做错了什么?我对prestashop还是个新手。提前感谢

检查您的Web服务权限,即“组”字段是否具有正确的权限?@Sachin您能告诉我怎么做吗?对不起,我很抱歉new@Sachin我做了一些研究,发现这个字段是可写的