用httpclient放热吗?休息(ISH)API
我正在使用Pipedrive API并尝试更新记录(交易,但端点并不重要)。 IS的格式如下。
https://companyDomain.pipedrive.com/api/v1/deals/DealID?api_token=API-Token
在公司域指定您的帐户的地方,veradir是我们正在更新的ID,而API令牌是Pipedrive提供的代币以访问API。这不是登录返回的代币,它是静态的,在第一天就不会更改 。 httpclient似乎想要一个基础地址,因此“ https://companydomain.pipedrive.com/”,然后类似以下内容:
HttpResponseMessage response = await client.PutAsJsonAsync(
$"api/v1/deals/{dealId}/", args);
其中args是一个我想更新的字段/s和value/s的类。
如果我将api_token作为“ args”中的字段包括在内,则找不到404。如果我将其附加到基本URL或$ api/v1/deals/{vareid}/返回权限的拒绝。
关于如何处理这个问题有什么建议吗?
我设法以30年的历史为生,避免了网络,现在所有人似乎都想要。看来我最终必须解决这个问题,因此最近的问题! ;-)
预先感谢
吉姆
I'm working with the pipedrive API and trying to update a record (deal, but the endpoint isn't important). The format of the is as follows.
https://companyDomain.pipedrive.com/api/v1/deals/DealID?api_token=API-Token
Where companydomain specifies your account with them, dealID is the ID we're updating and API token is the token supplied by pipedrive to access the API. It's not a token that's returned by logging in, it's static one, given on day one and never changes.
HttpClient seems to want a base address so "https://companyDomain.pipedrive.com/", then something like the following:
HttpResponseMessage response = await client.PutAsJsonAsync(
quot;api/v1/deals/{dealId}/", args);
Where args is a class with the field/s and value/s I want to update.
If I include the api_token as fields in "args", it returns a 404 not found. If I append it to the base url or the $api/v1/deals/{dealID}/ it returns permission denied.
Any suggestions as to how I can handle this?
I've managed to make a living coding for 30 years avoiding the web, now it's all anyone seems to want. Appears I have to finally get a handle on this, hence the recent questions! ;-)
Thanks in advance
Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用“?”附加它
因此,您的URL看起来像API/V1/DEALS/YOUR_ID?api_token = the_token
Append it with a "?"
So your URL should look like api/v1/deals/YOUR_ID?api_token=THE_TOKEN