用httpclient放热吗?休息(ISH)API

发布于 2025-01-21 05:57:10 字数 709 浏览 1 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过期情话 2025-01-28 05:57:10

用“?”附加它
因此,您的URL看起来像API/V1/DEALS/YOUR_ID?api_token = the_token

HttpResponseMessage response = await client.PutAsJsonAsync(
    $"api/v1/deals/{dealId}?api_token={apiToken}", args);

Append it with a "?"
So your URL should look like api/v1/deals/YOUR_ID?api_token=THE_TOKEN

HttpResponseMessage response = await client.PutAsJsonAsync(
    
quot;api/v1/deals/{dealId}?api_token={apiToken}", args);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文