Skip to content

Instantly share code, notes, and snippets.

@sohaibtariq
Forked from mehnoorsiddiqui/Portal-Script.html
Last active January 2, 2024 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sohaibtariq/345c5bf063ca7bf539119ac45f260a7e to your computer and use it in GitHub Desktop.
Save sohaibtariq/345c5bf063ca7bf539119ac45f260a7e to your computer and use it in GitHub Desktop.
<script>
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
// Show the dev portal widget
function showWidget() {
APIMaticDevPortal.show(
{
"container": "apimatic-widget",
"portalStyle": "default",
"codegenApiRoutes": {
"docsgen": "/api/api-entities/LLHlm5iwn7cxhbKpEHxF0N3gQNGYmzflcS5kryfaX72d6o2xbidiVQbqcp2bNcDq/portal-artifacts/docs/generated-file?template={template}",
"codegen": "/api/api-entities/LLHlm5iwn7cxhbKpEHxF0N3gQNGYmzflcS5kryfaX72d6o2xbidiVQbqcp2bNcDq/portal-artifacts/sdks/generated-file?template={template}",
"transform": "/api/api-entities/LLHlm5iwn7cxhbKpEHxF0N3gQNGYmzflcS5kryfaX72d6o2xbidiVQbqcp2bNcDq/portal-artifacts/specs/generated-file?format={format}",
"apiProxy": "https://proxy.apimatic.io/api/proxy"
},
"apiKey": "PkUYNyvjYA7DfFBwoKTjTDVXNjfG0ARc59qXFAwZ3srPAdRKCufvzvx8RAGPLywmXNrzQHZa6c1O52sK2RI_oQ**",
"baseUrl": "https://www.apimatic.io",
"enableExport": true,
"renameHttpToRest": false,
"enableConsoleCalls": true,
"useProxyForConsoleCalls": true,
"initialPlatform": "http_curl_v1",
"languageSettings": {
"http_curl_v1": {
"disableSdkDownload": true
},
"cs_net_standard_lib": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
},
"java_eclipse_jre_lib": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
},
"php_generic_lib_v2": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
},
"python_generic_lib": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
},
"ruby_generic_lib": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
},
"ts_generic_lib": {
"disableSdkDownload": false,
"sdkDownloadLink": ""
}
},
"allowedExportFormats": [
"postman10",
"postman20",
"openapi31json",
"openapi31yaml",
"openapi3json",
"openapi3yaml",
"swagger20",
"swaggeryaml",
"swagger10",
"raml",
"raml10",
"apiblueprint",
"wadl2009",
"apimatic",
"wsdl",
"insomnia",
"insomniayaml"
],
"themeOverrides": {
"themeType": "cool",
"palette": {
"primaryColor": "#05c2bc",
"linkColor": "#00C7D4"
},
"fontSource": [
"https://fonts.googleapis.com/css?family='Rubik':100,100i,300,300i,400,400i,500,500i,700,700i,900,900i",
"https://fonts.googleapis.com/css?family=Courier+Prime:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i"
],
"cssStyles": {
"headings": {
"fontFamily": "'Rubik', sans-serif",
"h1": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "27px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
},
"h2": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "24px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
},
"h3": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "21.36px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
},
"h4": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "18px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
},
"h5": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "16px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
},
"h6": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "15px",
"fontWeight": "500",
"fontStyle": "normal",
"lineHeight": "1.3"
}
},
"body": {
"fontFamily": "'Rubik', sans-serif",
"text1": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "15px",
"fontWeight": "400",
"fontStyle": "normal",
"lineHeight": "1.75"
},
"text2": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "13.33px",
"fontWeight": "400",
"fontStyle": "normal",
"lineHeight": "1.75"
},
"text3": {
"fontFamily": "'Rubik', sans-serif",
"fontSize": "11.85px",
"fontWeight": "400",
"fontStyle": "normal",
"lineHeight": "1.75"
}
},
"code": {
"fontFamily": "Courier Prime, monospace",
"blockCode": {
"fontFamily": "Courier Prime, monospace",
"fontSize": "15px",
"fontWeight": "400",
"fontStyle": "normal",
"lineHeight": "1.75"
},
"inlineCode": {
"fontFamily": "Courier Prime, monospace",
"fontSize": "15px",
"fontWeight": "400",
"fontStyle": "normal",
"lineHeight": "1.75"
}
}
}
}
}
);
};
const scriptUrl = "https://dxjs.apimatic.io/v7/static/js/portal.v7.js";
const script = document.createElement("script");
script.src = scriptUrl;
// Once the script is loaded, show the dev portal widget
script.onload = () => {
showWidget();
};
document.head.appendChild(script);
const portalButton = document.querySelector(
"header > div:nth-child(1) > div > div:nth-child(2) > a:nth-child(3)"
);
portalButton.addEventListener("click", () => waitForElm('#apimatic-widget').then(() => showWidget()));
</script>
<DIV class="SDKs">
# SDKs
Client libraries are available for the following programming languages:
## .NET
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/net-standard-library/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=cs_net_standard_lib)
- Install the Nuget Package using the .NET CLI with the following command:
```Text bash
dotnet add package petstore-api --version 1.0.0
```
## PHP
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/php/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=php_generic_lib_v2)
- Get the SDK Package from Composer using the following command
```Text bash
composer require petstore-sdk
```
## Python
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/python/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=python_generic_lib)
- Get the SDK Package from Pypi using the following command
```c bash
pip install petstore-sdk==1.0.0
```
## Ruby
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/ruby/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=ruby_generic_lib)
- Get the SDK Package from Rubygems using the following command
```Text bash
gem install petstore-sdk -v 1.0.0
```
## TypeScript
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/typescript/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=ts_generic_lib)
- Get the SDK Package from Rubygems using the following command
```Text bash
npm install petstore-sdk@1.0.0
```
## Java
- View the [SDK Documentation](https://www.apimatic.io/apidocs/{ YOUR DOCS SLUG }/v/1_0_11#/net-standard-library/step-by-step-tutorial)
- Download the [SDK Source Code](https://www.apimatic.io/api/api-entities/{ YOUR API KEY }/portal-artifacts/sdks/generated-file?template=java_eclipse_jre_lib)
- Get the SDK Package from [Maven](https://central.sonatype.com/)
</DIV>
<div class="SDKs">
<h1>SDKs</h1>
<p>Client libraries/SDKs are available for the following programming languages:</p>
<table>
<tbody>
<tr>
<td><img src="https://img.icons8.com/color/48/null/microsoft.png" /><strong>.Net</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=cs_net_standard_lib">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/net-standard-library/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
<tr>
<td><img src="https://img.icons8.com/color/48/null/java-coffee-cup-logo--v1.png" /><strong>Java</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=java_eclipse_jre_lib">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/java/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
<tr>
<td><img src="https://img.icons8.com/office/48/null/php-logo.png" /><strong> PHP</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=php_generic_lib_v2">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/php/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
<tr>
<td><img src="https://img.icons8.com/color/48/null/python--v1.png" /><strong>Python</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=python_generic_lib">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/python/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
<tr>
<td><img src="https://img.icons8.com/color/48/null/ruby-programming-language.png" /><strong>Ruby</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=ruby_generic_lib">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/ruby/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
<tr>
<td><img src="https://img.icons8.com/color/48/null/typescript.png" /><strong>Typescript</strong></td>
<td><img src="https://img.icons8.com/windows/24/null/download--v1.png" /><a href="https://www.apimatic.io/api/api-entities/{API-KEY}/portal-artifacts/sdks/generated-file?template=ts_generic_lib">Download</a></td>
<td><img src="https://img.icons8.com/ios-glyphs/24/null/document--v1.png" /><a href="https://www.apimatic.io/apidocs/petstore-api/v/1_0_11#/typescript/step-by-step-tutorial" target="_blank">Documentation</a></td>
</tr>
</tbody>
</table>
</div>
.markdown-body #apimatic-widget pre > code {
overflow: revert !important;
font-size: 15px !important;
padding: 0 !important;
line-height: 1.75 !important;
}
.markdown-body #apimatic-widget ul {
padding-left: 0 !important;
margin-bottom: 0 !important;
}
.markdown-body #apimatic-widget a[href], .markdown-body #apimatic-widget a:not([href=""]) {
text-decoration: none;
}
.App .rm-CustomPage header h1{
font-size:0 !important;
}
#content-container {
max-width:100% !important
}
.SDKs{
max-width: var(--container,1140px);
margin: 0 auto;
}
.SDKs table tr td:not(:first-child) {
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment