Planfix API: Authentication by token: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 9: | Line 9: | ||
In the example in the screenshot, only one authentication token is created, which, when used, will result in requests being made on behalf of the user John Smith (meaning requests to get tasks will return only tasks available to this user) | In the example in the screenshot, only one authentication token is created, which, when used, will result in requests being made on behalf of the user John Smith (meaning requests to get tasks will return only tasks available to this user) | ||
https://p.pfx.so/pf/Hh/rpUUJp.png | |||
If you want to use the API to modify all tasks, you can use a Robot | If you want to use the API to modify all tasks, you can use a Robot | ||
Line 16: | Line 16: | ||
<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;"> | <div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;"> | ||
<nowiki> | |||
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \ | curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \ | ||
-u 4db09df5a62a8a32a9522fcac02d3c6f:06540b851b466ccf84558573aff11b65 -k -d '<request>...</request>' https://api.planfix.ru/xml/ | -u 4db09df5a62a8a32a9522fcac02d3c6f:06540b851b466ccf84558573aff11b65 -k -d '<request>...</request>' https://api.planfix.ru/xml/ | ||
</nowiki> | |||
</div> | </div> | ||
Information for when creating the header yourself. The basic authentication header looks as follows: | |||
<source lang="bash"> | |||
Authorization : Basic NGRiMDlkZjVhNjJhOGEzMmE5NTIyZmNhYzAyZDNjNmY6WA== | |||
</source> | |||
where after Basic comes: base64('ApiKey:Token'); | |||
=== Go To === | |||
*[[XML API v1]] |
Latest revision as of 07:35, 1 July 2022
When authenticating using a token, each API call must contain a basic HTTP authentication header. Authentication tokens are created in the section Account Management / API Access, and they can be limited to only specific functions.
In the example in the screenshot, only one authentication token is created, which, when used, will result in requests being made on behalf of the user John Smith (meaning requests to get tasks will return only tasks available to this user)
If you want to use the API to modify all tasks, you can use a Robot
When authorizing using a token, use the API Key as the user and the authentication token as the password in the basic HTTP authentication header. When authorizing using a username and password, using the API Key as the user and leave the password empty. Example with token authentication:
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \ -u 4db09df5a62a8a32a9522fcac02d3c6f:06540b851b466ccf84558573aff11b65 -k -d '<request>...</request>' https://api.planfix.ru/xml/
Information for when creating the header yourself. The basic authentication header looks as follows:
Authorization : Basic NGRiMDlkZjVhNjJhOGEzMmE5NTIyZmNhYzAyZDNjNmY6WA==
where after Basic comes: base64('ApiKey:Token');