Post to

Posted by agiletortoise, Last update over 1 year ago

Post to a hosted account. After installing, generate an app token on your account page. The first time you run the action, you will be prompted to add the token.


  • script

      post to hosted account
      using Micropub API
    // First run, you will be prompted for
    // App Token. Generate tokens on the
    // Account page
    var credential = Credential.create("", "Insert app token generated on account page.");
    credential.addTextField("apptoken", "App Token");
    var appToken = credential.getValue("apptoken");
    // Setup API and content 
    var endpoint = ""
    var content = draft.content
    // create and post HTTP request
    var http = HTTP.create();
    var response = http.request({
      "url": endpoint,
      "method": "POST",
      "encoding": "form",
      "data": {
        "h": "entry",
        "content": content
      "headers": {
        "Authorization": "Bearer " + appToken
    console.log("Response: " + response.statusCode);
    if (response.statusCode != 200 && response.statusCode != 202) {;


  • After Success Default
    Notification Info
    Log Level Info
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.