Noratetsu Lab

動じないために。

タグの定義・詳細

Dynalist API

Dynalistの自分のデータを取得・操作できるAPI。
General – Dynalist API v1 Documentation

secret tokenを取得すれば自分のデータにアクセスできる。
データを取得することも変更することもできるので扱いには十分に注意が必要。

https://apidocs.dynalist.io/#document-level-api を使う例

const token = 'hoge'; // secret tokenをここに入れる(うっかり公開しないように注意)  
const fileId = 'fuga'; // ファイルのURL(https://dynalist.io/d/fuga)のfugaの部分を入れる   
fetch('https://dynalist.io/api/v1/doc/read', {  
    method: 'POST',  
    body: JSON.stringify({  
        token: token,  
        'file_id': fileId,  
    }),  
})  
    .then(response => response.json())  
    .then(data => {  
        console.log(data);  
        // dataを使って任意の処理  
    })  

返ってくるデータの例(Get content of a document – Dynalist API v1 Documentationより)

// code:example.json  
{  
  "_code": "OK",  
  "_msg": "",  
  "file_id": "",  
  "title": "Todo list",  
  "version": 15,  
  "nodes": [  
    {  
      "id": "",  
      "content": "Buy milk",  
      "note": "2L whole milk",  
      "created": 1552959309804, // timestamp in milliseconds of the creation time  
      "modified": 1552959335182, // timestamp in milliseconds of the last modified time  
      "children": []  
    },  
    {  
      "id": "",  
      "content": "Send Jason photos",  
      "note": "",  
      "checked": true,  
      "checkbox": true, // whether this item has checkbox  
      "color": 4, // color label, 0~6  
      "heading": 3, // heading level, 0~3  
      "created": 1552959309804,  
      "modified": 1552959335182,  
      "collapsed": true,  
      "children": [  
        "",  
      ]  
    },  
    {  
      "id": "",  
      "content": "Picnic photos",  
      "note": "",  
      "created": 1552959309904,  
      "modified": 1552959359783  
      "children": []  
    }  
  ]  
}  

Backlinks

他の「Programming」カテゴリの語句

「Dynalist API」タグの記事一覧

2025/02/26

アウトライン型データベースとしてのDynalist

 Dynalistはアウトライナーだが、私にとってはデータベースである。アウトライナーとして使えるデータベース、くらいの言い方をしてもいいかもしれない。

2024/01/23

サイトの作り方④取得したデータを加工する

 Noratetsu Houseの作り方の続きです。
 今回はDynalist APIで取得したデータの加工について。

2023/12/12

サイトの作り方③Dynalist APIを理解する

 Noratetsu Houseの作り方の続きです。
 今回はDynalist APIの利用について。

管理人

アイコン画像

のらてつ Noratetsu

キーワード

このブログを検索

検索

ブログ アーカイブ

2025
2024
2023
2022
2021