Skip to content

Commit bbcf5aa

Browse files
committed
link fixes
1 parent 554fb81 commit bbcf5aa

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

API.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## API Reference
22
Find the full API reference below with relevant links to further documentation.
33

4-
### Authentication [[View Docs](https://docs.cosmicjs.com/rest-api/authentication.html)]
4+
### Authentication [[View Docs](https://docs.cosmicjs.com/api-reference/authentication)]
55
Use your Cosmic account email and password to create an authentication token. **Authentication is only required for account-level access such as adding / removing Buckets from your account, getting user info, etc. The token is not required to query Bucket content**.
66
```javascript
77
const Cosmic = require('cosmicjs')() // empty init
@@ -17,7 +17,7 @@ Cosmic.authenticate({
1717

1818
### Buckets
1919

20-
#### Add Bucket [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#add-bucket)]
20+
#### Add Bucket [[View Docs](https://docs.cosmicjs.com/api-reference/buckets#add-bucket)]
2121
Add a new Bucket to your account.
2222
```javascript
2323
const Cosmic = require('cosmicjs')({
@@ -33,7 +33,7 @@ Cosmic.addBucket({
3333
})
3434
```
3535

36-
#### Get Buckets [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#get-buckets)]
36+
#### Get Buckets [[View Docs](https://docs.cosmicjs.com/api-reference/buckets#get-buckets)]
3737
Get all Buckets connected to your account.
3838
```javascript
3939
const Cosmic = require('cosmicjs')({
@@ -46,7 +46,7 @@ Cosmic.getBuckets().then(data => {
4646
})
4747
```
4848

49-
#### Connect to Bucket [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#connect-to-bucket)]
49+
#### Connect to Bucket [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction#api-access-keys)]
5050
Use the `Cosmic.bucket` method to connect to your Bucket. Get your Bucket slug located in <i>Your Bucket > Basic Settings > API Access</i> in your [Cosmic Dashboard](https:/www.cosmicjs.com/login).
5151
```javascript
5252
// Use the Cosmic.bucket method to connect to your Bucket.
@@ -57,7 +57,7 @@ const bucket = Cosmic.bucket({
5757
write_key: 'your-bucket-write-key'
5858
})
5959
```
60-
#### Get Bucket [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#get-bucket)]
60+
#### Get Bucket [[View Docs](https://docs.cosmicjs.com/api-reference/buckets#get-bucket)]
6161
Returns the basic Bucket information.
6262
```javascript
6363
const Cosmic = require('cosmicjs')({
@@ -69,7 +69,7 @@ Cosmic.getBucket({ slug: 'your-bucket-slug'}).then(data => {
6969
console.log(err)
7070
})
7171
```
72-
#### Delete Bucket [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#delete-bucket)]
72+
#### Delete Bucket [[View Docs](https://docs.cosmicjs.com/api-reference/buckets#delete-bucket)]
7373
Deletes the Bucket.
7474
```javascript
7575
const Cosmic = require('cosmicjs')({
@@ -85,7 +85,7 @@ Cosmic.deleteBucket({
8585
```
8686

8787
### Users
88-
#### Add Users [[View Docs](https://docs.cosmicjs.com/rest-api/users.html#add-user-to-bucket)]
88+
#### Add Users [[View Docs](https://docs.cosmicjs.com/api-reference/users#add-user)]
8989
Add a new User to your Bucket.
9090
```javascript
9191
const Cosmic = require('cosmicjs')({
@@ -109,7 +109,7 @@ bucket.addUser(params).then(data => {
109109
})
110110
```
111111

112-
#### Get Users [[View Docs](https://docs.cosmicjs.com/rest-api/users.html#get-users)]
112+
#### Get Users [[View Docs](https://docs.cosmicjs.com/api-reference/users#get-users)]
113113
Get users from your Bucket.
114114
```javascript
115115
const Cosmic = require('cosmicjs')({
@@ -127,7 +127,7 @@ bucket.getUsers().then(data => {
127127
})
128128
```
129129

130-
#### Get User [[View Docs](https://docs.cosmicjs.com/rest-api/users.html#get-user)]
130+
#### Get User [[View Docs](https://docs.cosmicjs.com/api-reference/users#get-user)]
131131
Get a user from your Bucket.
132132
```javascript
133133
const Cosmic = require('cosmicjs')({
@@ -146,7 +146,7 @@ bucket.getUser({ id: '5357ef811693be2118000001' }).then(data => {
146146
```
147147

148148
### Object Types
149-
#### Add Object Type [[View Docs](https://docs.cosmicjs.com/rest-api/object-types.html#add-object-type)]
149+
#### Add Object Type [[View Docs](https://docs.cosmicjs.com/api-reference/object-types#add-object-type)]
150150
Add a new Object Type to your Bucket.
151151
```javascript
152152
const bucket = Cosmic.bucket({
@@ -179,7 +179,7 @@ bucket.addObjectType(params).then(data => {
179179
console.log(err)
180180
})
181181
```
182-
#### Get Object Types [[View Docs](https://docs.cosmicjs.com/rest-api/object-types.html#get-object-types)]
182+
#### Get Object Types [[View Docs](https://docs.cosmicjs.com/api-reference/object-types#get-object-types)]
183183
Get all Object Types in your Bucket.
184184
```javascript
185185
const bucket = Cosmic.bucket({
@@ -193,7 +193,7 @@ bucket.getObjectTypes().then(data => {
193193
console.log(err)
194194
})
195195
```
196-
#### Edit Object Type [[View Docs](https://docs.cosmicjs.com/rest-api/object-types.html#edit-object-type)]
196+
#### Edit Object Type [[View Docs](https://docs.cosmicjs.com/api-reference/object-types#edit-object-type)]
197197
Edit an existing Object Type in your Bucket.
198198
```javascript
199199
const bucket = Cosmic.bucket({
@@ -210,7 +210,7 @@ bucket.editObjectType({
210210
console.log(err)
211211
})
212212
```
213-
#### Delete Object Type [[View Docs](https://docs.cosmicjs.com/rest-api/object-types.html#delete-object-type)]
213+
#### Delete Object Type [[View Docs](https://docs.cosmicjs.com/api-reference/object-types#delete-object-type)]
214214
Delete an existing Object Type from your Bucket. *This does not delete Objects in this Object Type.
215215
```javascript
216216
const bucket = Cosmic.bucket({
@@ -228,7 +228,7 @@ bucket.deleteObjectType({
228228
```
229229

230230
### Objects
231-
#### Add Object [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#add-object)]
231+
#### Add Object [[View Docs](https://docs.cosmicjs.com/api-reference/objects#add-object)]
232232
Add a new Object to your Bucket.
233233
```javascript
234234
const Cosmic = require('cosmicjs')()
@@ -265,7 +265,7 @@ bucket.addObject(params).then(data => {
265265
console.log(err)
266266
})
267267
```
268-
#### Get All Objects [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-objects)]
268+
#### Get All Objects [[View Docs](https://docs.cosmicjs.com/api-reference/objects#get-objects)]
269269
Returns all Objects from your Bucket.
270270
```javascript
271271
const bucket = Cosmic.bucket({
@@ -283,7 +283,7 @@ bucket.getObjects({
283283
})
284284
```
285285

286-
#### Get Objects by Type [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-objects)]
286+
#### Get Objects by Type [[View Docs](https://docs.cosmicjs.com/api-reference/objects#get-objects)]
287287
Get Objects from an Object Type. Uses `getObjects` method with additional `type` param.
288288
```javascript
289289
const bucket = Cosmic.bucket({
@@ -307,8 +307,8 @@ bucket.getObjects(params).then(data => {
307307
})
308308
```
309309

310-
#### Queries [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#advanced-queries-beta)]
311-
Advanced queries give you powerful NoSQL database-like functionality for content fetching. Use the `query` parameter to send a valid JSON (stringified) query on the Get Objects Endpoint. View more examples in [the docs](https://docs.cosmicjs.com/rest-api/objects.html#advanced-queries-beta).
310+
#### Queries and Logic [[View Docs](https://docs.cosmicjs.com/api-reference/queries)]
311+
Queries and logic give you powerful NoSQL database-like functionality for content fetching. Use the `query` parameter to send a valid JSON (stringified) query on the Get Objects Endpoint. View more examples in [the docs](https://docs.cosmicjs.com/api-reference/queries).
312312
```javascript
313313
const bucket = Cosmic.bucket({
314314
slug: 'your-bucket-slug',
@@ -348,7 +348,7 @@ const data = await bucket.getMergeRequestObjects({
348348
```
349349
Use these Objects to then overright Objects from the target Bucket response based on unique `slug` and `locale` identifiers. An example of this logic can be found in the [Next Merge template](https://github.com/cosmicjs/next-merge/blob/master/lib/merge.js#L19).
350350

351-
### Get Single Object [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-object)]
351+
### Get Single Object [[View Docs](https://docs.cosmicjs.com/api-reference/objects#get-object)]
352352
Returns a single Object from your Bucket.
353353

354354
**By Id**
@@ -369,7 +369,7 @@ bucket.getObject({
369369
})
370370
```
371371

372-
#### Edit Object [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#edit-object)]
372+
#### Edit Object [[View Docs](https://docs.cosmicjs.com/api-reference/objects#edit-object)]
373373
Edit an existing Object in your Bucket.
374374
```javascript
375375
const bucket = Cosmic.bucket({
@@ -387,7 +387,7 @@ bucket.editObject({
387387
})
388388
```
389389

390-
#### Edit Object Metafields [[View Docs](https://docs.cosmicjs.com/rest-api/metafields.html#edit-metafields)]
390+
#### Edit Object Metafields [[View Docs](https://docs.cosmicjs.com/api-reference/object-metafields#edit-object-metafield)]
391391
You can edit an existing Object's Metafields by using the following method. This method allows you to edit specific Metafields identified by `key`, without affecting other Metafields.
392392
```javascript
393393
const bucket = Cosmic.bucket({
@@ -421,7 +421,7 @@ bucket.editObjectMetafields(params)
421421
})
422422
```
423423

424-
#### Delete Object [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#delete-object)]
424+
#### Delete Object [[View Docs](https://docs.cosmicjs.com/api-reference/objects#delete-object)]
425425
Delete an existing Object in your Bucket.
426426
```javascript
427427
const bucket = Cosmic.bucket({
@@ -440,7 +440,7 @@ bucket.deleteObject({
440440

441441
### Object Revisions
442442

443-
#### Get Object Revisions [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-object-revisions)]
443+
#### Get Object Revisions [[View Docs](https://docs.cosmicjs.com/api-reference/object-revisions)]
444444
Returns all Object Revisions from the specified Object.
445445
```javascript
446446
const bucket = Cosmic.bucket({
@@ -459,7 +459,7 @@ bucket.getObjectRevisions({
459459
})
460460
```
461461

462-
#### TODO Add Object Revision [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#add-object-revision)]
462+
#### TODO Add Object Revision [[View Docs](https://docs.cosmicjs.com/api-reference/object-revisions)]
463463
Add Object Revision to an Object.
464464
```javascript
465465
const bucket = Cosmic.bucket({
@@ -479,7 +479,7 @@ bucket.addObjectRevision({
479479
```
480480

481481
### Media
482-
#### Add Media [[View Docs](https://docs.cosmicjs.com/rest-api/media.html#add-media)]
482+
#### Add Media [[View Docs](https://docs.cosmicjs.com/api-reference/media#add-media)]
483483
The only required post value is media which is the name of your media sent.
484484
```javascript
485485
const bucket = Cosmic.bucket({
@@ -500,7 +500,7 @@ bucket.addMedia({
500500
console.log(err)
501501
})
502502
```
503-
#### Get Media [[View Docs](https://docs.cosmicjs.com/rest-api/media.html#get-media)]
503+
#### Get Media [[View Docs](https://docs.cosmicjs.com/api-reference/media#get-media-list)]
504504
You can add the `folder` parameter to get Media from a certain folder. You can use the full [Imgix suite of image processing tools](https://imgix.com) on the URL provided by the `imgix_url` property value. Check out the Imgix documentation for more info.
505505
```javascript
506506
const bucket = Cosmic.bucket({
@@ -518,7 +518,7 @@ bucket.getMedia({
518518
console.log(err)
519519
})
520520
```
521-
#### Delete Media [[View Docs](https://docs.cosmicjs.com/rest-api/media.html#delete-media)]
521+
#### Delete Media [[View Docs](https://docs.cosmicjs.com/api-reference/media#delete-media)]
522522
```javascript
523523
const bucket = Cosmic.bucket({
524524
slug: 'your-bucket-slug',
@@ -534,7 +534,7 @@ bucket.deleteMedia({
534534
})
535535
```
536536
### TODO Webhooks
537-
#### Add Webhook [[View Docs](https://docs.cosmicjs.com/rest-api/webhooks.html#add-webhook)]
537+
#### Add Webhook [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
538538
Sends a POST request to the endpoint of your choice when the event occurs. The data payload in the same fomat as Object and Media. Read more about Webhooks including the payload sent to the endpoint on the <a href='https:/docs./cosmicjs/docs/webhooks' target='_blank'>Webhooks documentation page</a>.
539539
```javascript
540540
bucket.addWebhook({
@@ -546,7 +546,7 @@ bucket.addWebhook({
546546
console.log(err)
547547
})
548548
```
549-
#### TODO Get Webhooks [[View Docs](https://docs.cosmicjs.com/rest-api/webhooks.html#get-webhooks)]
549+
#### TODO Get Webhooks [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
550550
Get webhooks in your Bucket. Authentication token is required in the header (see Authentication section). Must have admin level access.
551551
```javascript
552552
bucket.getWebhooks()
@@ -557,7 +557,7 @@ bucket.getWebhooks()
557557
console.log(err)
558558
})
559559
```
560-
#### TODO Delete Webhook [[View Docs](https://docs.cosmicjs.com/rest-api/webhooks.html#delete-a-webhook)]
560+
#### TODO Delete Webhook [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
561561
```javascript
562562
bucket.deleteWebhook({
563563
id: 'c62defe0-5f93-11e7-8054-873245f0e98d'
@@ -568,7 +568,7 @@ bucket.deleteWebhook({
568568
})
569569
```
570570
### TODO Extensions
571-
#### Add Extension [[View Docs](https://docs.cosmicjs.com/rest-api/extensions.html#add-extension)]
571+
#### Add Extension [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
572572
Adds an Extension to your Bucket. Post values include `zip` (which is the name of your file sent) or `zip_url` (which is the url of the zip file) or `url` (which is hosted url of extension). Note: You can only post one of these at a time. Read more about Extensions on the <a href='https://docs.cosmicjs.com/extensions' target='_blank'>Extensions documentation page</a>.
573573
```javascript
574574
bucket.addExtension({
@@ -581,7 +581,7 @@ bucket.addExtension({
581581
console.log(err)
582582
})
583583
```
584-
#### Get Extensions [[View Docs](https://docs.cosmicjs.com/rest-api/extensions.html#get-extensions)]
584+
#### Get Extensions [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
585585
Get Extensions in your Bucket. Authentication token is required in the header (see Authentication section). Must have admin level access.
586586
```javascript
587587
bucket.getExtensions()
@@ -592,7 +592,7 @@ bucket.getExtensions()
592592
console.log(err)
593593
})
594594
```
595-
#### Edit Extension [[View Docs](https://docs.cosmicjs.com/rest-api/extensions.html#edit-extension)]
595+
#### Edit Extension [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
596596
If a write key is enabled on the requested bucket, the parameter `write_key` will need to be present. For security, `query_params` values will be saved as JavaScript Web Tokens (JWT), but available in your Extension as a decoded value.
597597
```javascript
598598
bucket.editExtension({
@@ -615,7 +615,7 @@ bucket.editExtension({
615615
console.log(err)
616616
})
617617
```
618-
#### Delete Extension [[View Docs](https://docs.cosmicjs.com/rest-api/extensions.html#delete-extension)]
618+
#### Delete Extension [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction)]
619619
```javascript
620620
bucket.deleteExtension({
621621
id: 'c62defe0-5f93-11e7-8054-873245f0e98d'

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ npm install cosmicjs
4040

4141
## Basic Usage
4242

43-
#### Connect to Bucket [[View Docs](https://docs.cosmicjs.com/rest-api/buckets.html#connect-to-bucket)]
44-
Use the `Cosmic.bucket` method to connect to your Bucket. Get your Bucket slug located in <i>Your Bucket > Basic Settings > API Access</i> in your [Cosmic Dashboard](https://www.cosmicjs.com/login).
43+
#### Connect to Bucket [[View Docs](https://docs.cosmicjs.com/api-reference/getting-started/introduction#api-access-keys)]
44+
Use the `Cosmic.bucket` method to connect to your Bucket. Get your Bucket slug located in <i>Your Bucket > Basic Settings > API Access</i> in your [Cosmic Dashboard](https://app.cosmicjs.com/login).
4545
```javascript
4646
// Use the Cosmic.bucket method to connect to your Bucket.
4747
const Cosmic = require('cosmicjs')()
@@ -52,8 +52,8 @@ const bucket = Cosmic.bucket({
5252
})
5353
```
5454

55-
### Get Objects by Type [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-objects)]
56-
Get Objects from an Object Type. Uses `getObjects` method with additional `type` param. Additional options noted below. [See docs for more options](https://docs.cosmicjs.com/rest-api/objects.html#get-objects) including powerful [Advanced Queries](https://docs.cosmicjs.com/rest-api/objects.html#advanced-queries-beta).
55+
### Get Objects by Type [[View Docs](https://docs.cosmicjs.com/api-reference/objects)]
56+
Get Objects from an Object Type. Uses `getObjects` method with additional `type` param. Additional options noted below. [See docs for more options](https://docs.cosmicjs.com/api-reference/objects) including powerful [queries and logic](https://docs.cosmicjs.com/api-reference/queries).
5757
```javascript
5858
const params = {
5959
query: {
@@ -71,7 +71,7 @@ bucket.getObjects(params).then(data => {
7171
})
7272
```
7373

74-
### Get Single Object [[View Docs](https://docs.cosmicjs.com/rest-api/objects.html#get-object)]
74+
### Get Single Object [[View Docs](https://docs.cosmicjs.com/api-reference/objects#get-object)]
7575
Returns a single Object from your Bucket.
7676

7777
**By Id**
@@ -105,7 +105,7 @@ bucket.getObjects({
105105
})
106106
```
107107
## Further Documentation
108-
See the [API reference](API.md) and [full documentation](https://docs-v2.cosmicjs.com/api-reference/objects) for more requests and capabilities.
108+
See the [API reference](API.md) and [full documentation](https://docs.cosmicjs.com) for more requests and capabilities.
109109

110110
## License
111111
This project is published under the [MIT](LICENSE) license.

0 commit comments

Comments
 (0)