API Quick Reference Guide
Ocavu Network is now The Velocity Access Network. The Ocavu Network will be deprecated as of January 31, 2023. The enhanced Velocity Access Network is currently in Beta testing and will be live in late-Q1 2023.
The Velocity Access Network is a meta-layer that sits on top (or next to) your existing digital property, whether it is a website, mobile app, metaverse, or other.
The Velocity Access Network “Core” consists of the following primary functions:
- User authentication and management
- Session management (access/security)
- Off-chain redemption management API (e.g. ticket scanning, gating content, etc.)
- Blockchain APIs (e.g. wallet, minting, transfers, etc.)
In short, the Velocity Access Network can instantly add Web3 functionality to your digital property.
Hello Velocity Example
The simplest way to utilize the Velocity Access Network is to insert the SDK anywhere on your web page, but ideally as close to the bottom of the page as possible so that the rest of the page renders first:
<script src="https://vx.run/v"></script>
And one of the simplest ways to gate content based on user login using basic CSS display/hide classes is to add the following classes to any element on your webpage:
vLoginRequired – Only display the content if logged in
<div class="vLoginRequired">This is gated content for only logged in users</div>
vLoginPrompt – Only display the content if not logged in and click to open the Ocavu Network tab
<div class="vLoginPrompt">Click here to view this gated content</div>
Here is the complete HTML page code for this Hello World Example:
<!DOCTYPE html> <html> <head> <title>Hello Ocavu</title> </head> <body> <center> <h1>Hello Velocity</h1> <div class="vLoginRequired">This is gated content for only logged in users</div> <div class="vLoginPrompt">Click here to view this gated content</div> </center> <script src="https://vx.run/v"></script> </body> </html>
Copy the above code into a file.html on your laptop or any web server and open it in your browser.
Please note that if your CMS does not already load jQuery, we automatically import the latest stable release of jQuery. Nonetheless, it is on the Velocity Access development roadmap to refactoring the platform and eliminate the jQuery dependency in a future major release.
API URLs
Current Off-Chain APIs URL:
https://www.ocavu.net/[endpoint]/
Current Blockchain NFT APIs URL:
https://www.seeknftmint.com/api/v1/[endpoint]/
Current Blockchain Crypto APIs URL:
https://www.seeknftmint.com/crypto/[endpoint]/
Best practice is to universally pass SID private key as the header “Authorization” value with all API calls except for the authentication endpoints such as knock, phone, and auth.
Native Mobile App Login Integration
The general flow of utilization of the Ocavu Network using only the back-end APIs:
- Use the ocavu.net/phone/ endpoint to check if user registered
- Request an authentication code with the ocavu.net/knock/ endpoint with country and phone payload
- If not, require that user enter email address to request authentication code
- Submit the authentication code to generate a new Session ID (ephemeral private key) using the ocavu.net/auth/ endpoint with country, phone and auth payload
- If successful authentication, check if user registered
- If not registered, register user
- Return Session ID and uid
- Get the user’s tribe data using the ocavu.net/get/ endpoint
- Store tribe data for various application uses
- Check if user has an Ocavu Network custodial wallet by checking the “chains” property of tribe data
- If not, assign next available custodial wallet using the {{url}}/assignWallet/ endpoint with uid payload
- Store the new wallet in user’s tribe data using the ocavu.net/chainsupdate/ endpoint with wallet_address payload
Off-Chain APIs
ocavu.net/allowed/
Check if user is allowed to edit a tribe.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
{ "tribe": "zxcvbnm" }
ocavu.net/auth/
Check if authorization code is correct and if so, return the sid and uid.
Header:
- none
Payload:
- country: [country code]
- auth: [phone number]
- code: [authentication code]
{ "country":"+1", "auth":"2125551212", "code":"1234" }
ocavu.net/auction/
Create an auction supplying start and end time as seconds since the epoch and starting price. Also must specify the asset_id and org_symbol.
{ "meta": { "start_time": "1664256001", "end_time": "1665256001", "start_price": "1" }, "asset_id": "yvtxch5v3925fs9x3r7cn", "org_symbol": "CougsRise" }
ocavu.net/bids/
{"auction_id": "c1559ab723376f9d42dc5ba2f35f6f2a"}
ocavu.net/bid/
{ "org_symbol": "CougsRise", "auction_id": "c1559ab723376f9d42dc5ba2f35f6f2a", "bid_price": "1.2" }
ocavu.net/check/
Check if SID is a valid session ID and if so, return the uid.
Header:
- Authorization: [SID]
"Authorization" : "abcd1234defg5678"
Payload:
- None
ocavu.net/chief/
Add chief to tribe.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- chief: [tribe id]
{ "tribe": "zxcvbnm", "chief": "qwertyuiop" }
ocavu.net/unchief/
Remove chief from tribe.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- chief: [tribe id]
{ "tribe": "zxcvbnm", "chief": "qwertyuiop" }
ocavu.net/chopsid/
Destroy a session.
Header:
- None
Payload:
- id : [SID]
"id" : "abcd1234defg5678"
ocavu.net/get/
Return tribe data (user account or generic tribe). If tribe is not specified, then return user’s tribe data. If “token” is specified then returns the tribe data with the specified token and if the “tribe” parameter is also specified, then “tribe” is ignored.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
{ "tribe": "zxcvbnm" }
… or …
{ "token": "abcd" }
ocavu.net/knock/
Request an authorization code be texted to a user.
Header:
- None
Payload:
- type: phone
- country: [country code]
- auth: [phone number]
- msg: [Optional – authentication code message]
{ "type":"phone", "country":"+1", "auth":"2125551212", "msg":"Ocavu Authorization Code: [v/code]\nExpires in [v/minutes] minutes." }
Variables:
- [v/code] – is replaced with the randomly generated authentication code
- [v/minutes] – is replaced with the configured number of minutes till the code expires
- [v/seconds] – is replaced with the configured number of seconds till the code expires
ocavu.net/link/
Link to a tribe from tribe. Default is your uid, pulled from your sid. This is similar to an Instagram “follow”.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- link: [tribe id]
{ "tribe": "zxcvbnm", "link": "qwertyuiop" }
ocavu.net/grouplinks/
Return array of count of links to assets in org and whether current is linked.
Header:
- Authorization
Payload:
- tribe: [uid]
- org: [organization symbol]
{ "tribe":"zxcv1234asdf5678", "org":"ocavu" }
ocavu.net/phone/
Check if a phone number is registered.
Header:
- none
Payload:
- country: [country code]
- phone: [phone number]
{ "country":"+1", "phone":"2125551212" }
ocavu.net/poll/
Check if a poll is active and return the next poll question.
Header:
- none
Payload:
{ }
ocavu.net/put/
Update tribe data (user account or generic tribe). If tribe is not specified, the update user’s tribe data.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- key1: value1
- key2: value2
- key3: value3
{ "tribe": "zxcvbnm", "key1": "value1", "key2": "value2", "key3": "value3"
}
By default, /put/ returns the updated tribe data. However, this requires a small bit of additional compute for the final data query. If maximizing performance is critical and you do not need the full set of current tribe data returned in the response of /put/ you can eliminate this extra compute cycle by adding the _get parameter and setting it to false.
Payload:
{
"tribe":"zxcvbnm",
"_get":"false"
}
ocavu.net/search/
Search tribe data (token_id, name, description, meta) for the search term, optionally filtered by type and return an array of tribes data. Search is case in-sensitive.
Header:
Payload:
- term: [search term or phrase]
- type: [tribe type: org, user, asset, event, ticket, etc.]
{ "type":"user",
"term":"Jon"
}
ocavu.net/sids/
Check a list of active sessions of the logged in user.
Header:
- Authorization : [SID]
“Authorization” : “abdc1234defg5678”
Payload:
- none
ocavu.net/tree/
Returns a list of tribes (and tribe data) for all tribes linked to tribe. Optionally filter on type. This is similar to getting a list of who someone is following on Instagram.
Header:
- N/A
Payload:
- type: [type]
- tribe: [tribe id]
{ "type": "asset", "tribe": "qwertyuiop" }
ocavu.net/type/
Return all of the tribes of a type. If tribe is not specified, then return type = user. Limit (page size) defaults to 100 records. Offset defaults to 0 or the first page. Returns null array if no records found.
Header:
- N/A
Payload:
- type: [type]
- org: [org symbol]
- limit: [page size]
- offset: [page offset, starting at 0]
{ "type": "user", "limit": 100, "offset": 0 }
or…
{ "org": "ocavu" }
ocavu.net/txns/
Return all of the tribes of a type or org. If type is not specified, then org must be specified. If type is not specified, then return type = user. Limit (page size) defaults to 100 records. Offset defaults to 0 or the first page. Returns null array if no records found.
Header:
- N/A
Payload:
- tribe: [tribe id]
- type: [type]
- org: [org symbol]
- limit: [page size]
- offset: [page offset, starting at 0]
{ "tribe": "zxcv1234",
"type": "user", "limit": 100, "offset": 0 }
or…
{ "org": "ocavu" }
ocavu.net/username/
ocavu.net/token/
Update token or username.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- token: [token]
{ "tribe": "zxcvbnm", "token": "ocavu" }
ocavu.net/unlink/
Unlink a tribe from tribe. Default is your uid, pulled from your sid. This is similar to an Instagram “unfollow”.
Header:
- Authorization : [SID]
"Authorization" : "abcd1234efgh5678"
Payload:
- tribe: [tribe id]
- link: [tribe id]
{ "tribe": "zxcvbnm", "link": "qwertyuiop" }
Blockchain NFT APIs
{{url}}/assignWallet/
Look up the next available Ocavu Network custodial wallet and assign it to the uid of the supplied SID.
Header:
- Authorization : [SID]
Payload:
- chain: MATIC
{ "chain":"MATIC" }
Variables:
- None
{{url}}/findWallet/
List the wallet addresses of a user.
Header:
- Authorization : [SID]
Payload:
- uid: [uid]
{ "uid":"zxcvbnm", "offset":0, "page_size":10 }
Variables:
- None
{{url}}/findOrganization/
Find the organization blockchain info.
Header:
- Authorization : [SID]
Payload:
{ "name": "OcavuNetwork" }
Variables:
- None
{{url}}/mintNFT/
Find the organization blockchain info.
Header:
- Authorization : [SID]
Payload:
{ "chain":"MATIC", "organization":"CougsNFT", "to": "0x7f0c0ed82b8c6a72577100b8445063e8533eed86", "name": "Bob Sledding Bonanza", "description": "Xmas 2021", "url": "https://www.seek.works/cdn/v/_z3/_1b/_z31b8wp6q8zm3xf88mp35_seek-execs-2021-xmaspng/z31b8wp6q8zm3xf88mp35_Seek-Execs-2021-Xmas.png", "mintprice": 5, "animation_url":"", "attributes":[ [ { "trait_type":"Color", "value":"Gold" } ] }
Variables:
- None
{{url}}/listAssets/
List all assets in a wallet.
Header:
- Authorization : [SID]
Payload:
{ "wallet_address":"0x7f0C0Ed82B8c6a72577100B8445063E8533eed86", "chain":"MATIC", "offset":0, "page_size":50 }
Variables:
- None
{{url}}/transferAsset/
Transfer an NFT from an Ocavu Network custodial wallet to another custodial or non-custodial wallet.
Header:
- Authorization : [SID]
Payload:
{ "chain":"MATIC", "contractAddress":"0x0b22280F37BfF3be604f2B5Db0f40a0662005DF2", "tokenId": "2", "custodialAddress":"0x50cB0A3Fd66Dd4cB8FBac1e27C45582D7E821528", "recipient": "0x7f0C0Ed82B8c6a72577100B8445063E8533eed86" }
Variables:
- None
{{url}}/getNFT/
Check if an NFT exists in a wallet based on the specified traits (attributes) and if so, return the first one.
Header:
- Authorization : [SID]
Payload:
{ "owner_address": "0x50cB0A3Fd66Dd4cB8FBac1e27C45582D7E821528", "color": "black" }
Variables:
- None
{{url}}/collectionList/
List all assets minted by an organization.
Header:
- Authorization : [SID]
Payload:
{ "chain":"MATIC", "page_size":10, "offset":0, "organization":"cryptopia" }
Variables:
- None
Airdrop APIs
{{url}}/giveNFT/
Airdrop a pre-minted NFT to a user.
Header:
- Authorization : [SID]
Payload:
{
"owner_address": "0x7f0C0Ed82B8c6a72577100B8445063E8533eed86",
"color": "Gold",
"recipient_address": "0x6B757DF56bBAde039e3434f76EB011e73160727C"
}
Variables:
- None
{{url}}/getRandomNFT/
In a pre-mint airdrop, get the next batch-minted NFT with the specified traits.
Header:
- Authorization : [SID]
Payload:
{
"wallet_address": "0x50cB0A3Fd66Dd4cB8FBac1e27C45582D7E821528",
"color":"Gold"
}
Variables:
- None
Blockchain Crypto APIs
{{cryptoUrl}}/accountBalance/
Look up the next available Ocavu Network custodial wallet and assign it to the uid of the supplied SID.
Header:
- Authorization : [SID]
Payload:
- chain: MATIC
{
"chain":"MATIC"
}
Variables:
- None
{{cryptoUrl}}/transferMatic/
Look up the next available Ocavu Network custodial wallet and assign it to the uid of the supplied SID.
Header:
- Authorization : [SID]
Payload:
- sender: [wallet address]
- recipient: [wallet address]
- currency: [token symbol]
- amount: [amount of tokens]
{
"sender": "0x550716fbba51e1e90f7cdb19023207f3f1f30288",
"recipient": "0x0A10b1daA17262bdcE5627dF05Afa3326E58C7DD",
"currency": "MATIC",
"amount": "1.23"
}
Variables:
- None
{{cryptoUrl}}/transferERC20Token/
Look up the next available Ocavu Network custodial wallet and assign it to the uid of the supplied SID.
Header:
- Authorization : [SID]
Payload:
- sender: [wallet address]
- recipient: [wallet address]
- currency: [token symbol]
- amount: [amount of tokens]
{ "chain": "MATIC", "sender": "0x0A10b1daA17262bdcE5627dF05Afa3326E58C7DD", "recipient": "0x550716fbba51e1e90f7cdb19023207f3f1f30288", "token": "USDC", "amount": "1" }
Variables:
- None
Estimate Gas Fees APIs
{{url}}/estimateFee
Estimate gas fees for minting an NFT.
Header:
- Authorization : [SID]
Payload:
{
"chain": "MATIC",
"type": "MINT_NFT_BATCH",
"minter": "0x66f53378b5ebe3b9fbc934f5814c1d6552648e5d",
"recipients": [
"0x5801242cc97078ae21c42e3b148c343c1e01739d",
"0x5801242cc97078ae21c42e3b148c343c1e01739d"
],
"contractAddress":"0x7C81a74286bAFbE011Cb1B8606b2c44Ddd96e218",
"tokenIds":["100","101"],
"meta_url": [
"https://ipfs.io/ipfs/bafkreigj5r7i2vut7j2isgbt62xkbe7mh5kn4ztl6vbbrecr7xjfusteq4",
"https://ipfs.io/ipfs/bafkreigj5r7i2vut7j2isgbt62xkbe7mh5kn4ztl6vbbrecr7xjfusteq4"
]
}
Variables:
- None