Trelloのリストにカードが置かれているとき、Harvestで請求書を生成するのが本質的です。私はZapierを試しましたが、インボイスの機能は組み込まれていません。POST GETまたはZapierトリガーPOSTアクションへ
私はこれを自分で開発する必要があります。 TrelloはJavascriptやPythonのアクションを持っているので、私はその2つの言語に限定されています。
ZAPIER: Trello Trigger > Javascript or Python code
は、私は私が含む基本的なログイン認証を使用して最低限 PythonやJavaScriptでこれを投稿することができますどのように
https://[site].harvestapp.com/invoices
Authorization: Basic amNtMjU4MkBnbWFpbC5jb206YTEwMDUw**NB
Content-Type: application/javascript
Accept: application/json
{ "invoice": { "due_at_human_format": "NET 10", "client_id": 3849315, "currency" : "United States Dollar - USD", "issued_at": "2015-04-22", "subject": "Your invoice subject goes here", "notes": "Some notes go here", "number": "303197", "kind": "project", "projects_to_invoice": "120353", "import_hours": "yes", "import_expense": "yes", "period_start": "2015-03-01", "period_end": "2016-03-31", "expense_period_start": "2015-03-31", "expense_period_end": "2016-03-31" } }
に送信する必要がJSONリクエストを持っています論理?コードのサンプルビットが役に立ちます。
UPDATE: 私はこのコードを追加したが、それはポストマン外で働くことを得るように見えることはできません
var data = JSON.stringify({
"invoice": {
"due_at_human_format": "NET 10",
"client_id": 3849315,
"currency": "United States Dollar - USD",
"issued_at": "2015-04-22",
"subject": "Your invoice subject goes here",
"notes": "Some notes go here",
"number": "303197",
"kind": "project",
"projects_to_invoice": "120353",
"import_hours": "yes",
"import_expense": "yes",
"period_start": "2015-03-01",
"period_end": "2016-03-31",
"expense_period_start": "2015-03-31",
"expense_period_end": "2016-03-31"
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://[url].harvestapp.com/invoices");
xhr.setRequestHeader("authorization", "Basic amNtMjU4MkBnbWFpbC***TEwMDUwMTNB");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "2c652344-1be5-8969-adf3-a7ca9ee7179f");
xhr.send(data);
私は収穫で実行するようにコードを変更したが、それは文句を言わない郵便配達の外で働きます。 –