Skip to content

Commit

Permalink
hardcode /bulk example for now
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Nov 5, 2023
1 parent f1735a4 commit c1e3634
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
pnpm-lock.yaml
.next
.turbo
dist
dist
apps/docs/api-reference/endpoint/bulk-create-links.mdx
42 changes: 42 additions & 0 deletions apps/docs/api-reference/endpoint/bulk-create-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,45 @@ openapi: post /projects/{slug}/links/bulk
[Custom social media
cards](https://dub.co/help/article/how-to-create-link#custom-social-media-cards)
</Warning>

<RequestExample>
```bash cURL
curl --request POST \
--url https://api.dub.co/projects/{slug}/links/bulk \
--header 'Authorization: Bearer {YOUR_TOKEN}' \
--header 'Content-Type: application/json' \
--data '[
{
"domain": "yourdomain.com",
"url": "https://www.youtube.com/"
},
{
"domain": "yourdomain.com",
"url": "https://www.google.com/"
}
...
]'
```
```javascript JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer {YOUR_TOKEN}', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
"domain": "yourdomain.com",
"url": "https://www.youtube.com/"
},
{
"domain": "yourdomain.com",
"url": "https://www.google.com/"
},
...
])
};

fetch('https://api.dub.co/projects/steven/links/bulk', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
```
</RequestExample>

0 comments on commit c1e3634

Please sign in to comment.