差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

下次修改
前次修改
tech:redmine_api [2021/01/03 22:52] – 建立 jonathantech:redmine_api [2021/01/03 23:26] (目前版本) jonathan
行 1: 行 1:
 +====== Redmine API 呼叫整理 ======
 +
 +  * Example: 新增 user <cli>
 +curl -v \
 +    -H "X-Redmine-API-Key: 75f5100dea8c9b40812695e251697cece50d366b" \
 +    -H "Content-Type: application/json" \
 +    -d '{
 +"user": {
 +        "login": "super4",
 +        "firstname": "#",
 +        "lastname": "Super User4",
 +        "mail": "[email protected]",
 +        "password": "IIIdevops123!",
 +        "admin": "True"
 +    }
 +}' \
 +    http://172.16.0.104:32748/users.json
 +
 +</cli>
 +
 +===== DB 資料表資訊 =====
 +  * user 密碼編碼參考 - https://www.redmine.org/boards/2/topics/31915 <cli>sha1($salt . sha1($password));</cli>
 +  * tokens 內 api 的 created_on 時間必須在 settings 內 rest_api_enabled = 1 的 updated_on 時間之後, 才不會造成呼叫 API 出現 token 有安全問題無法使用
 +
 +===== 參考網址 =====
 +  * https://www.redmine.org/projects/redmine/wiki/rest_api
 +  * https://www.redmine.org/projects/redmine/wiki/Rest_api_with_curl
 +  * https://documenter.getpostman.com/view/916999/T1DtfFxf
 +  * https://gist.github.com/shentonfreude/5173720