顯示具有 token 標籤的文章。 顯示所有文章
顯示具有 token 標籤的文章。 顯示所有文章

2026/01/02

今天打開PDM看到這個




















查了一下是自簽的憑証過期了
想說就砍掉重加
重加出現











到forum上找了一下
發現要把之前PDM在原來node的token砍掉

1) Visit the target PVE.
2) Select Datacenter.
3) Select Permission->API Token.
4) You will then find the API Token that PDM created. Delete it.

2023/04/09

在 proxmox backup server 中使用 api 撈取相關資料

先建立 API token 要記住 token













再設定權限















使用 curl 撈取相關資料 範例如下

curl --location --insecure --request GET 'https://10.0.0.1:8007/api2/json/nodes/{localhost}/tasks' --header 'Authorization: PBSAPIToken=root@pam!abc:your_token'|jq

API相關資料路徑可參考以下原廠連結


2022/09/10

今天想使用 line 發群組通知

首先申請權杖

 

官方文件範例是使用 curl


$ curl -X POST -H 'Authorization: Bearer <access_token>' -F 'message=foobar' \

https://notify-api.line.me/api/notify

 

但試了半天發現一個問題 就是 message 無法換行 

找了好久才找到 範例如下


第一個方法


curl -X POST      -H 'Authorization: Bearer (your token)'      --data-binary message="%0A中文%0A123%0Aabc%0A456"      https://notify-api.line.me/api/notify


第二個方法

curl -X POST    -H 'Authorization: Bearer (your token)'   -d $'message=123\nabc'  https://notify-api.line.me/api/notify


使用python範例如下

檔名存為 line_notify.py

檔案內容如下


import requests

import sys


f = open(sys.argv[1])

msg = f.read()

f.close


def lineNotify(token, msg):

    url = "https://notify-api.line.me/api/notify"

    headers = {

        "Authorization": "Bearer " + token

    }

    payload = {'message': msg}

    r = requests.post(url, headers=headers, data=payload)

    return r.status_code


token = "your token"

lineNotify(token, msg)


只要指定檔案發送
檔案內是什麼內容
發送就是什麼內容

用法

python line_notify.py /tmp/txt_to_send


https://xenby.com/b/274-%E6%95%99%E5%AD%B8-%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-line-notify-%E5%B0%8D%E7%BE%A4%E7%B5%84%E9%80%B2%E8%A1%8C%E9%80%9A%E7%9F%A5


https://officeguide.cc/python-line-notify-send-messages-images-tutorial-examples/


https://fm-aid.com/bbs2/viewtopic.php?pid=52815


https://notify-bot.line.me/zh_TW/


https://notify-bot.line.me/doc/en/

2022/05/17

如何使用 postman 登入 juice shop 並拿到 bearer token


用 POST 而且在 body 以 json 格式輸入 登入的 email及密碼











auth type 選擇 No Auth










Send 後 畫面下方即可得到 bearer token