Skip to content

Instantly share code, notes, and snippets.

@cadecairos
Last active December 28, 2015 19:29
Show Gist options
  • Save cadecairos/7550215 to your computer and use it in GitHub Desktop.
Save cadecairos/7550215 to your computer and use it in GitHub Desktop.

POST [/api/20130724/make]

Create a make

  • Headers

    • authorization - Hawk compatible authorization header
      • 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
      • For more information about using Hawk, see https://github.com/hueniverse/hawk
  • Body

      {
          make: {
              // required fields
              email: "[email protected]",
              url: "http://notarealurl.com/make_asdf.html",
              contentType: "application/x-applicationName",
              title: "title of make",
              // optional fields
              contenturl: "http://realMakeURL.com/notbehindaproxy",
              locale: "en_CA",
              description: "description of make",
              thumbnail: "http://fakeimageURL.com/img123.gif",
              author: "anonymous person",
              tags: [
                  "foo",
                  "bar"
              ],
              remixedFrom: "OBJECTIDOFANOTHERMAKE"
          }
      }
    
  • Response 200 {application/json}

      {
          // The created Make in JSON format
      }
    

PUT [/api/20130724/make/{id}]

Update a make

  • Headers

    • authorization - Hawk compatible authorization header
      • 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
      • For more information about using Hawk, see https://github.com/hueniverse/hawk
  • Parameters

    • id (string) ... ID of the Make to be updated
  • Body

      {
          make: {
              // any combination of fields to be updated (see create Route for fields)
          }
      }
    
  • Response 200 {application/json}

      {
          // The updated Make in JSON format
      }
    

DELETE [/api/20130724/make/{id}]

Delete a make

  • Headers

    • authorization - Hawk compatible authorization header
      • 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
      • For more information about using Hawk, see https://github.com/hueniverse/hawk
  • Parameters

    • id (string) ... ID of the Make to be updated
  • Response 200 {application/json}

      {
          // The Deleted Make in JSON format
      }
    

GET [/api/20130724/make/search]

Search for makes

  • Query Params

    • author (string) - Author Name
    • user (string) - Webmaker Username
    • tags (string) - Comma separated string of tags
    • tagPrefix (string) - String representing the beginning of a tag
    • url (string) - Url of the make
    • contentType (string) - The contentType of the make
    • remixedFrom (string) - Object ID of a Make
    • id (string) - Object ID of a make
    • title (string) - Title of a make
    • description (string) - Description of a Make
    • limit (number) - Number of make results to return (MAX)
    • page (number) - Page number to request. i.e. 1000 results, 10 per page, show page 15
    • sortByField (string) - A make field on which to sort search results by.
    • or (string) - define to be any truthy value to have fields match on an "OR" basis. i.e. title is "a" or has the tag "b"
  • Response 200 {application/json}

      {
          makes: [
              // Array of Make Objects that matched search results
          ],
          total: {number} // total number of make records that matched your query (useful for building paginated UI)
      }
    

PUT [/api/20130724/make/like/:id]

Adds a Webmaker User ID to a Makes likes array

  • Headers

    • authorization - Hawk compatible authorization header
      • 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
      • For more information about using Hawk, see https://github.com/hueniverse/hawk
  • Parameters

    • id (string) ... Id of the Make to add a like to
  • Body

      {
          maker: "makerUsername"
      }
    
  • Response 200 {application/json}

      {
          // The just-liked Make in JSON format
      }
    

PUT [/api/20130724/make/unlike/:id]

Removes a Webmaker User ID from the Makes likes array

  • Headers

    • authorization - Hawk compatible authorization header
      • 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
      • For more information about using Hawk, see https://github.com/hueniverse/hawk
  • Parameters

    • id (string) ... Id of the Make to remove a like from
  • Body

      {
          maker: "makerUsername"
      }
    
  • Response 200 {application/json}

      {
          // The just-unliked Make in JSON format
      }
    

GET [/api/20130724/make/tags]

returns an array of tags that can be used to auto-complete the query parameter

  • Query Params

    • t (string) - A string to run the auto-complete request on
    • s (number) - A number representing how many results to return. Default is 10, Max is 1000
  • Response

      {
          tags: [
              {
                  term: "tag", // tag suggestion
                  count: {num} // number of occurences detected
              }
          ],
          total: {num} // number of suggestions found. May not equal the length of the tags array.
      }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment