Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

hardcode /bulk example for now

Steven Teyc1e36345a35c
diff --git a/.prettierignore b/.prettierignore
index 5203ec8c73..dbb84aa39a 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -2,4 +2,5 @@ node_modules
pnpm-lock.yaml
.next
.turbo
-dist
\ No newline at end of file
+dist
+apps/docs/api-reference/endpoint/bulk-create-links.mdx
\ No newline at end of file
diff --git a/apps/docs/api-reference/endpoint/bulk-create-links.mdx b/apps/docs/api-reference/endpoint/bulk-create-links.mdx
index cc93a4deb6..7147c3d0c9 100644
--- a/apps/docs/api-reference/endpoint/bulk-create-links.mdx
+++ b/apps/docs/api-reference/endpoint/bulk-create-links.mdx
@@ -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>
\ No newline at end of file