使用REST API更新客户 [英] Updating Customer with REST API

查看:73
本文介绍了使用REST API更新客户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用REST API更新应收款客户的状态字段。更具体地说,我正在使用OAuth2身份验证,已成功获取令牌,并试图更新使用$ filter选择的单个客户记录的状态字段。

I am attempting to to update the Status field of an A/R Customer using the REST API. More specifically I am using OAuth2 authentication, have successfully obtained a token, and am attempting to update the Status field of a single customer record selected by using a $filter.

我正在使用的请求:

PUT /entity/Default/17.200.001/Customer?$filter=CustomerID%20eq%20ABC HTTP / 1.1
内容-类型:application / json; charset = utf-8
授权:Bearer 44243e3a1393348480857be1ebc34ff9

PUT /entity/Default/17.200.001/Customer?$filter=CustomerID%20eq%20ABC HTTP/1.1 Content-Type: application/json; charset=utf-8 Authorization: Bearer 44243e3a1393348480857be1ebc34ff9

请求正文:

{状态:{值:无效}}

{"Status": {"value": "Inactive"}}

这将返回500错误。我是与Acumatica集成的新手。我究竟做错了什么?

This returns a 500 error. I am new at integrating with Acumatica. What am I doing wrong?

推荐答案

由于您使用的是客户屏幕的键字段,即客户ID字段,您是否尝试过直接将ID添加到网址而不使用过滤器参数?

Since you are using the key field of the Customer screen, the CustomerID field, have you tried just adding the ID directly in the URL without using the filter parameter?

PUT /entity/Default/17.200.001/Customer/ABC

PUT /entity/Default/17.200.001/Customer/ABC

这篇关于使用REST API更新客户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆