# data[].attributes.body
而我在等你

炊煙裊裊昇起

隔江千萬里

# data[].attributes.body
Created using the API from GAS!!

code

function createPadletPost() {
  var apiKey = 'xxx';
  var boardId = 'yyy';  // 替換為您的 board_id
  var url = 'https://api.padlet.dev/v1/boards/' + boardId + '/posts';

  var payload = {
    "data": {
      "type": "post",
      "attributes": {
        "content": {
          "subject": "Test post",
          "body": "Created using the API!",
          "attachment": {
            "url": "http://example.com",
            "caption": "Example website"
          }
        },
        "color": "red"
      }
    }
  };

  var options = {
    'method': 'post',
    'headers': {
      'Content-Type': 'application/json',
      'X-API-KEY': apiKey
    },
    'payload': JSON.stringify(payload),
    'muteHttpExceptions': true
  };

  var response = UrlFetchApp.fetch(url, options);
  var responseCode = response.getResponseCode();
  if (responseCode === 201) {
    var responseData = JSON.parse(response.getContentText());
    Logger.log('Post created successfully: ' + responseData.data.id);
  } else {
    Logger.log('Error: ' + responseCode);
    Logger.log('Response: ' + response.getContentText());
  }
}

# data[].attributes.body
function getBoardSections() {
  var apiKey = 'xxx';
  var boardId = 'yyy';  // 替換為您的 board_id
  var url = 'https://api.padlet.dev/v1/boards/' + boardId + '?include=sections';

  var options = {
    'method': 'get',
    'headers': {
      'Content-Type': 'application/json',
      'X-API-KEY': apiKey
    },
    'muteHttpExceptions': true
  };

  var response = UrlFetchApp.fetch(url, options);
  var responseCode = response.getResponseCode();
  if (responseCode === 200) {
    var responseData = JSON.parse(response.getContentText());
    Logger.log('Sections: ' + JSON.stringify(responseData.data.relationships.sections.data));
  } else {
    Logger.log('Error: ' + responseCode);
    Logger.log('Response: ' + response.getContentText());
  }
}

# data[].attributes.body
var sectionid ='zzz'
function createPadletPost() {
  var apiKey = 'xxx';
  var boardId = 'yyy';  // 替換為您的 board_id
  var url = 'https://api.padlet.dev/v1/boards/' + boardId + '/posts';

  var attachments = [
    {
      "type": "file",
      "url": "http://example.com/file.pdf",
      "caption": "Example PDF File"
    },
    {
      "type": "link",
      "url": "http://example.com",
      "caption": "Example Website"
    },
    {
      "type": "camera_photo",
      "url": "http://example.com/photo.jpg",
      "caption": "Example Camera Photo"
    },
    {
      "type": "video_recording",
      "url": "http://example.com/video.mp4",
      "caption": "Example Video Recording"
    },
    {
      "type": "audio_recording",
      "url": "http://example.com/audio.mp3",
      "caption": "Example Audio Recording"
    },
    {
      "type": "screen_recording",
      "url": "http://example.com/screen_recording.mp4",
      "caption": "Example Screen Recording"
    },
    {
      "type": "drawing",
      "url": "http://example.com/drawing.png",
      "caption": "Example Drawing"
    },
    {
      "type": "poll",
      "question": "Example Poll",
      "options": ["Option 1", "Option 2"]
    },
    {
      "type": "google_drive",
      "url": "http://drive.google.com/file/example",
      "caption": "Example Google Drive File"
    },
    {
      "type": "gif",
      "url": "http://example.com/animation.gif",
      "caption": "Example GIF"
    },
    {
      "type": "youtube",
      "url": "http://youtube.com/example",
      "caption": "Example YouTube Video"
    },
    {
      "type": "spotify",
      "url": "http://spotify.com/example",
      "caption": "Example Spotify Track"
    },
    {
      "type": "location",
      "latitude": 37.7749,
      "longitude": -122.4194,
      "locationName": "San Francisco"
    }
  ];

  attachments.forEach(function(attachment) {
    var payload = {
      "data": {
        "type": "post",
        "attributes": {
          "content": {
            "subject": "Multimedia Post",
            "body": "This post includes various multimedia content.",
            "attachment": attachment
          },
          "color": "purple"
        },
        "relationships": {
          "section": {
            "data": {
              "id": sectionid
            }
          }
        }
      }
    };

    var options = {
      'method': 'post',
      'headers': {
        'Content-Type': 'application/json',
        'X-API-KEY': apiKey
      },
      'payload': JSON.stringify(payload),
      'muteHttpExceptions': true
    };

    var response = UrlFetchApp.fetch(url, options);
    var responseCode = response.getResponseCode();
    if (responseCode === 201) {
      var responseData = JSON.parse(response.getContentText());
      Logger.log('Post created successfully: ' + responseData.data.id);
    } else {
      Logger.log('Error: ' + responseCode);
      Logger.log('Response: ' + response.getContentText());
    }
  });
}

# data[].attributes.body
When AI solves your problemThis is a perfect meme for AI enthusiasts!

# data[].attributes.body
(代號：00692)

# data[].attributes.body
有關水泥及水泥製品之生產及運銷
有關水泥原料及水泥製品原料之開採製造運銷及附屬礦石之開採經銷
經營有關水泥工業及其附屬事業

# data[].attributes.attachment_link.description
台泥企業團，是一個全神貫注，處理人類文明與大自然之間複雜關係的綠色環境工程公司。