Bitly Bundles API Preliminary Documentation

5
This is a preliminary documentation for the bitly Bundles API. For general guidelines regarding the bitly API, please visit http://api.bitly.com. ----------- All bundle API endpoints return the following output: * bundle_owner: the bitly user who owns this bundle (the authenticated user on whose behalf the bundle was created). * created_ts: a timestamp representing the time at which this bundle was created. * description: a description of this bundle. * bundle_link: a URL pointing directly to this bundle. * last_modified_ts: a timestamp representing the last time this bundle was modified. * private: a true/false value indicating whether this bundle is set to be private. * links: the links in the bundle. Each link returns the following fields: * aggregate_link: the global bitly link for the specified long_url, which can be used to track aggregate stats across all matching bitly links. * link: the bitly link for the specified long_url, unique to this user's account. * description: a description of this link. * title: the title of this link, automatically populated from the destination page title and editable with the /v3/bundle/link_edit endpoint. * long_url: the destination long URL for this link. * display_order: the order in which this link will display, starting with 0 for the link to be displayed first. -------------------- API Endpoints: /v3/bundle/create Creates a new bitly bundle, owned by the authenticated user. Input: * access_token: an OAuth token for the user on whose behalf a bundle is being created. Example: https://api-ssl.bitly.com/v3/bundle/create?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d { status_code: 200 - data: { - bundle: { bundle_owner: "bundlestest" created_ts: 1310496952 description: "" links: [ ] title: "" bundle_link: " http://bit.ly/bundles/bundlestest/1" last_modified_ts: 1310496952 private: false } } status_txt: "OK" } ------ /v3/bundle/contents Returns the contents of a specified bundle. Input: * access_token: an OAuth token for the authenticated end-user. * bundle_link: the URL corresponding to the bundle to be returned. https://api-ssl.bitly.com/v3/bundle/contents?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles %2Fbundlestest%2F1 { status_code: 200 - data: { - bundle: { bundle_owner: "bundlestest" created_ts: 1310496952 description: "Some links in a bundle" - links: [ -

Transcript of Bitly Bundles API Preliminary Documentation

Page 1: Bitly Bundles API Preliminary Documentation

This is a preliminary documentation for the bitly Bundles API.

For general guidelines regarding the bitly API, please visit http://api.bitly.com.

-----------

All bundle API endpoints return the following output:

* bundle_owner: the bitly user who owns this bundle (the authenticated user on whose behalf the bundle was created).* created_ts: a timestamp representing the time at which this bundle was created.* description: a description of this bundle.* bundle_link: a URL pointing directly to this bundle.* last_modified_ts: a timestamp representing the last time this bundle was modified.* private: a true/false value indicating whether this bundle is set to be private.* links: the links in the bundle. Each link returns the following fields:

* aggregate_link: the global bitly link for the specified long_url, which can be used to track aggregate stats across all matching bitly links.* link: the bitly link for the specified long_url, unique to this user's account.* description: a description of this link.* title: the title of this link, automatically populated from the destination page title and editable with the /v3/bundle/link_edit endpoint.* long_url: the destination long URL for this link.* display_order: the order in which this link will display, starting with 0 for the link to be displayed first.

--------------------

API Endpoints:

/v3/bundle/create

Creates a new bitly bundle, owned by the authenticated user.

Input:* access_token: an OAuth token for the user on whose behalf a bundle is being created.

Example:https://api-ssl.bitly.com/v3/bundle/create?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: ""links: [ ]title: ""bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310496952private: false

}}status_txt: "OK"

}

------

/v3/bundle/contents

Returns the contents of a specified bundle.

Input:* access_token: an OAuth token for the authenticated end-user.* bundle_link: the URL corresponding to the bundle to be returned.

https://api-ssl.bitly.com/v3/bundle/contents?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: "Some links in a bundle"-links: [

-

Page 2: Bitly Bundles API Preliminary Documentation

{aggregate_link: "http://bit.ly/2EEjBl"link: "http://bit.ly/pDLYrb"description: ""title: "CNN.com - Breaking News, U.S., World, Weather, Entertainment & Video News"long_url: "http://www.cnn.com/"display_order: 0

}-{

aggregate_link: "http://bit.ly/001"link: "http://bit.ly/op4MfF"description: "Computers n Stuff"title: "Not An Orange"long_url: "http://www.apple.com/"display_order: 1

}]title: "My Test Bundle"bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310498060private: false

}}status_txt: "OK"

}

-------

/v3/bundle/edit

Modifies the metadata (title/description) and/or privacy setting for a specified bundle.

Input:* access_token: an OAuth token for the authenticated end-user.* bundle_link: the URL corresponding to the bundle to be modified.* edit (optional): a field designating which properties (title, description) are to be edited, allowing for these fields to be updated with empty values.* title (optional): a title for the specified bundle.* description (optional): a description for the specified bundle.* privacy (optional): a "true" or "false" value representing whether or not the specified bundle should set to private.

https://api-ssl.bitly.com/v3/bundle/edit?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1&edit=title,description&title=My%20Test%20Bundle&description=

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: ""-links: [

-{

aggregate_link: "http://bit.ly/2EEjBl"link: "http://bit.ly/pDLYrb"description: ""title: "CNN.com - Breaking News, U.S., World, Weather, Entertainment & Video News"long_url: "http://www.cnn.com/"display_order: 0

}-{

aggregate_link: "http://bit.ly/001"link: "http://bit.ly/op4MfF"description: "Computers n Stuff"title: "Not An Orange"long_url: "http://www.apple.com/"display_order: 1

}]title: "My Test Bundle"bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310572615private: false

Page 3: Bitly Bundles API Preliminary Documentation

}}status_txt: "OK"

}

--------------

/v3/bundle/link_add

Adds a link to an existing bundle.

Input:* access_token: an OAuth token for the authenticated end-user.* bundle_link: the URL corresponding to the bundle to which the link will be added.* link: the long URL to be added to the specified bundle.

Example:

https://api-ssl.bitly.com/v3/bundle/link_add?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1&link=http%3A%2F%2Fwww.google.com

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: ""-links: [

-{

aggregate_link: "http://bit.ly/2V6CFi"link: "http://bit.ly/rt5efV"description: ""title: "Google"long_url: "http://www.google.com/"display_order: 0

}]title: ""bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310497082private: false

}}status_txt: "OK"

}

------------

/v3/bundle/link_reorder

Modifies the display_order of a specified link in a bundle.

Input:* access_token: an OAuth token for the authenticated end-user.* bundle_link: the URL corresponding to the bundle in which the link will be reordered.* link: the bitly link to be reordered in this bundle.* display_order: the new display_order value to be assigned to the the specified link.

https://api-ssl.bitly.com/v3/bundle/link_reorder?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1&link=http%3A%2F%2Fbit.ly%2Frt5efV&display_order=0

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: "Some links in a bundle"-links: [

-{

Page 4: Bitly Bundles API Preliminary Documentation

aggregate_link: "http://bit.ly/2V6CFi"link: "http://bit.ly/rt5efV"description: ""title: "Google"long_url: "http://www.google.com/"display_order: 0

}-{

aggregate_link: "http://bit.ly/001"link: "http://bit.ly/op4MfF"description: ""title: "Apple"long_url: "http://www.apple.com/"display_order: 1

}]title: "My Test Bundle"bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310497379private: false

}}status_txt: "OK"

}

-----------

/v3/bundle/link_remove

Removes a specified link from a bundle.

Input:* access_token: an OAuth token for the authenticated end-user.* bundle_link: the URL corresponding to the bundle from which the link will be removed.* link: the bitly link to be removed from this bundle.

https://api-ssl.bitly.com/v3/bundle/link_remove?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1&link=http%3A%2F%2Fbit.ly%2Frt5efV

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: "Some links in a bundle"-links: [

-{

aggregate_link: "http://bit.ly/001"link: "http://bit.ly/op4MfF"description: ""title: "Apple"long_url: "http://www.apple.com/"display_order: 0

}]title: "My Test Bundle"bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310497435private: false

}}status_txt: "OK"

}

------------

/v3/bundle/link_edit

Modifies the metadata (title/description) for a specified link in a bundle.

Input:* access_token: an OAuth token for the authenticated end-user.

Page 5: Bitly Bundles API Preliminary Documentation

* bundle_link: the URL corresponding to the bundle in which the link will be edited.* link: the bitly link to be edited.* edit (optional): a field designating which properties (title, description) are to be edited, allowing for these fields to be updated with empty values.* title (optional): a title for the specified link.* description (optional): a description for the specified link.

https://api-ssl.bitly.com/v3/bundle/link_edit?access_token=0b13fe43a729faff4641d5370a0eb69554182e0d&bundle_link=http%3A%2F%2Fbit.ly%2Fbundles%2Fbundlestest%2F1&link=http%3A%2F%2Fbit.ly%2Fop4MfF&edit=title,description&title=Not%20An%20Orange&description=Computers%20n%20Stuff

{status_code: 200-data: {

-bundle: {

bundle_owner: "bundlestest"created_ts: 1310496952description: "Some links in a bundle"-links: [

-{

aggregate_link: "http://bit.ly/001"link: "http://bit.ly/op4MfF"description: "Computers n Stuff"title: "Not An Orange"long_url: "http://www.apple.com/"display_order: 0

}]title: "My Test Bundle"bundle_link: "http://bit.ly/bundles/bundlestest/1"last_modified_ts: 1310497773private: false

}}status_txt: "OK"

}