Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 3.42 KB

File metadata and controls

76 lines (49 loc) · 3.42 KB

some API testing sutff:

example post: https://www.linkedin.com/posts/abdibrokhim_i-know-you-are-struggling-to-find-an-idea-activity-7285736275242864644-ehpY?utm_source=share&utm_medium=member_desktop

[shorten]

[shorten_url]: for testing the shorten endpoint, you can use the following curl command: curl -X POST -H "Content-Type: application/json"
-d '{"original_url":"https://www.linkedin.com/posts/abdibrokhim_i-know-you-are-struggling-to-find-an-idea-activity-7285736275242864644-ehpY?utm_source=share&utm_medium=member_desktop"}'
http://localhost:8000/shorten

then open browser and go to http://localhost:8000/replace_with_your_short_code to see the redirect in action.

[wallet]

[create_wallet]: for testing the wallet creation endpoint, you can use the following curl command: curl -X POST -H "Content-Type: application/json"
-d '{"wallet_address":"6Wv8kxRJsNxmh2e2wdpXNnLpFQuik59Gghk2nDvSCaHL"}'
http://localhost:8000/wcreate

my sol address: 6Wv8kxRJsNxmh2e2wdpXNnLpFQuik59Gghk2nDvSCaHL . feel free to send some sol to me. LOL

[update_wallet_tries]: curl -X POST -H "Content-Type: application/json"
-d '{"wallet_address":"6Wv8kxRJsNxmh2e2wdpXNnLpFQuik59Gghk2nDvSCaHL"}'
http://localhost:8000/wupdate

[encrypt]

[encrypt_url]: curl -X POST -H "Content-Type: application/json"
-d '{"original_url":"https://x.com/search?q=%24TRUMP&src=trend_click&vertical=trends", "encrypt": true}'
http://localhost:8000/shorten

curl -X POST -H "Content-Type: application/json"
-d '{"original_url":"https://chatgpt.com/c/67a43d48-47d0-8003-b292-9419faaa2910", "encrypt": false}'
http://localhost:8000/shorten

[expire]

[expire_url]: curl -X POST -H "Content-Type: application/json"
-d '{"original_url":"https://www.linkedin.com/posts/abdibrokhim_im-building-blazingly-fast-url-shortener-activity-7286433490663862274-zvKb?utm_source=share&utm_medium=member_desktop", "encrypt": true, "transaction_hash": "34xPKazmdeJyJtpTyiQSTo848YEs1AetzbSJnQLUmhPBWK4nB4xRJY5fpA244YQrjh5xNDAHUrmYVEP6oWKoqSWK"}'
http://localhost:8000/shorten

[expire_url_immediate]: curl -X POST -H "Content-Type: application/json"
-d '{"short_url_id": 3}'
http://localhost:8000/expire

ps: it works only for paid urls. i mean there should be transaction_hash in the request body.

[get_all_short_urls]

curl -X GET http://localhost:8000/all-urls