### HTTP GET Request and JSON Response Example Source: https://restfulapi.net/http-methods/ Demonstrates an HTTP GET request for a user resource and the corresponding JSON response payload, showing user details. ```HTTP HTTP GET /users/1 ``` ```JSON { "id": 1, "username": "admin", "email": "[email protected]"} ``` -------------------------------- ### Example HTTP GET Request for OAuth 2.0 Authorization Source: https://tools.ietf.org/html/rfc6749 Illustrates how a client directs the user-agent to make an HTTP GET request to the authorization endpoint. This example shows the 'response_type', 'client_id', 'state', and 'redirect_uri' parameters in the query string. ```HTTP GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 Host: server.example.com ``` -------------------------------- ### REST API HTTP Methods Overview Source: https://restfulapi.net/http-methods/ Comprehensive guide to using HTTP methods (GET, POST, PUT, DELETE, PATCH) according to REST architectural guidelines, including their purpose, idempotency, safety, and standard response codes for API interactions. ```APIDOC HTTP Methods ============ REST guidelines suggest using a specific HTTP method on a particular type of call made to the server i.e. GET, POST, PUT or DELETE. REST APIs enable you to develop all kinds of web applications having all possible CRUD (create, retrieve, update, delete) operations. REST guidelines suggest using a specific HTTP method on a particular type of call made to the server (though technically it is possible to violate this guideline, yet it is highly discouraged). Use the below-given information to find a suitable HTTP method for the action performed by API. Table of Contents HTTP GET HTTP POST HTTP PUT HTTP DELETE HTTP PATCH Summary Glossary 1. HTTP GET ------------ Use _GET_ requests **to retrieve resource representation/information only** – and not modify it in any way. As GET requests do not change the resource’s state, these are said to be **safe methods**. Additionally, **GET APIs should be idempotent.** Making multiple identical requests must produce the same result every time until another API (POST or PUT) has changed the state of the resource on the server. If the Request-URI refers to a data-producing process, it is the produced data that shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process. 1.1. GET API Response Codes * For any given HTTP GET API, if the resource is found on the server, then it must return HTTP response code `[200 (OK)](https://restfulapi.net/http-status-200-ok/)` – along with the response body, which is usually either XML or JSON content (due to their platform-independent nature). * In case the resource is NOT found on the server then API must return HTTP response code `404 (NOT FOUND)`. * Similarly, if it is determined that the GET request itself is not correctly formed then the server will return the HTTP response code `400 (BAD REQUEST)`. ``` -------------------------------- ### HTTP GET Method Example URIs Source: https://restfulapi.net/http-methods/ Examples of URIs for the HTTP GET method, used for retrieving resources, including collections, filtered collections, specific resources, and sub-resources. ```APIDOC HTTP GET http://www.appdomain.com/users HTTP GET http://www.appdomain.com/users?size=20&page=5 HTTP GET http://www.appdomain.com/users/123 HTTP GET http://www.appdomain.com/users/123/address ``` -------------------------------- ### Example OAuth 2.0 Implicit Grant Authorization Request Source: https://tools.ietf.org/html/rfc6749 An example HTTP GET request demonstrating how a client directs a user-agent to the authorization endpoint with the necessary parameters for the Implicit Grant flow, using TLS. ```HTTP GET /authorize?response_type=token&client_id=s6BhdRkqt3&state=xyz &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 Host: server.example.com ``` -------------------------------- ### Example Problem Details JSON Response Source: https://context7_llms An example JSON object representing a problem details response, indicating an 'out of credit' error with specific details and an instance URI. ```json { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### Example: Generic ProblemDetails JSON Response Source: https://context7_llms A JSON example illustrating a standard ProblemDetails object, typically used for general API errors like 'out of credit'. ```JSON { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### HTTP POST Method Overview and Example URIs Source: https://restfulapi.net/http-methods/ Details the HTTP POST method for creating new subordinate resources or new resources in a collection. Explains its non-safe, non-idempotent nature, cacheability, and appropriate response codes (201 Created, 200 OK, 204 No Content). Includes example URIs. ```APIDOC HTTP POST http://www.appdomain.com/users HTTP POST http://www.appdomain.com/users/123/accounts ``` -------------------------------- ### HTTP PUT Method Overview and Example URIs Source: https://restfulapi.net/http-methods/ Explains the HTTP PUT method for updating existing resources or creating new ones if they don't exist. Discusses its non-cacheable nature, appropriate response codes (201 Created, 200 OK, 204 No Content), and the distinction from POST regarding resource targeting. Includes example URIs. ```APIDOC HTTP PUT http://www.appdomain.com/users/123 HTTP PUT http://www.appdomain.com/users/123/accounts/456 ``` -------------------------------- ### Example ProblemDetails JSON Response Source: https://context7_llms An example JSON payload demonstrating the structure of a ProblemDetails object, typically returned for API errors, including type, title, status, detail, and instance. ```json { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### Example HTTP POST Request for Client Credentials Grant Source: https://tools.ietf.org/html/rfc6749 Demonstrates an example HTTP POST request to the token endpoint for obtaining an access token using the Client Credentials Grant. It includes host, authorization header, content type, and the 'grant_type' parameter in the request body. ```HTTP POST /token HTTP/1.1 Host: server.example.com Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Content-Type: application/x-www-form-urlencoded grant_type=client_credentials ``` -------------------------------- ### Example OAuth 2.0 MAC Token Protected Resource Access Source: https://tools.ietf.org/html/rfc6749 Shows the initial part of an HTTP GET request for accessing a protected resource using an OAuth 2.0 MAC (Message Authentication Code) token. This token type involves signing specific components of the HTTP request. ```HTTP GET /resource/1 HTTP/1.1 Host: example.com Authorization: MAC id="h480djs93hd8", ``` -------------------------------- ### Summary of RESTful HTTP Methods Source: https://restfulapi.net/http-methods/ A comprehensive summary of standard HTTP methods (POST, GET, PUT, PATCH, DELETE) detailing their corresponding CRUD operations, expected behavior, and appropriate use cases for both collection resources and single resources in a REST API. ```APIDOC HTTP Method Summary: POST: CRUD: Create Collection Resource (/users): Response: 201 (Created), 'Location' header with link to /users/{id} containing new ID Single Resource (/users/123): Usage: Avoid using POST on a single resource GET: CRUD: Read Collection Resource (/users): Response: 200 (OK), list of users. Use pagination, sorting, and filtering to navigate big lists Single Resource (/users/123): Response: 200 (OK), single user. 404 (Not Found), if ID not found or invalid PUT: CRUD: Update/Replace Collection Resource (/users): Usage: 405 (Method not allowed), unless updating every resource in the entire collection Single Resource (/users/123): Response: 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid PATCH: CRUD: Partial Update/Modify Collection Resource (/users): Usage: 405 (Method not allowed), unless modifying the collection itself Single Resource (/users/123): Response: 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid DELETE: CRUD: Delete Collection Resource (/users): Usage: 405 (Method not allowed), unless deleting the whole collection — use with caution Single Resource (/users/123): Response: 200 (OK). 404 (Not Found), if ID not found or invalid ``` -------------------------------- ### Example: ProblemDetails with Validation Errors JSON Response Source: https://context7_llms A JSON example demonstrating a ProblemDetails object that includes an 'errors' property, often used for detailed validation failures in an HttpValidationProblemDetails context. ```JSON { "errors": {}, "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### Example HTTP Request for OAuth 2.0 Access Token Source: https://tools.ietf.org/html/rfc6749 An example HTTP POST request to the token endpoint for obtaining an access token, indicating the use of TLS. ```HTTP POST /token HTTP/1.1 ``` -------------------------------- ### Example OAuth 2.0 Access Token JSON Response Source: https://tools.ietf.org/html/rfc6749 This JSON object represents a simplified example of a successful response from an OAuth 2.0 token endpoint, containing an access token, token type, expiration time, and an example parameter. ```JSON { "access_token":"2YotnFZFEjr1zCsicMWpAA", "token_type":"example", "expires_in":3600, "example_parameter":"example_value" } ``` -------------------------------- ### HTTP PATCH Request with JSON Patch Example Source: https://restfulapi.net/http-methods/ Shows an example of an HTTP PATCH request to partially update a user resource, specifically replacing the email address using a JSON Patch operation. ```HTTP HTTP PATCH /users/1 ``` ```JSON [{ "op": "replace", "path": "/email", "value": "[email protected]" }] ``` -------------------------------- ### Example JSON for 400 Bad Request Response Source: https://context7_llms An example JSON payload for a 400 Bad Request response, illustrating the 'ProblemDetails' structure with common error fields. ```JSON { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### HTTP DELETE Method Overview and Example URIs Source: https://restfulapi.net/http-methods/ Covers the HTTP DELETE method for removing resources. Highlights its idempotency and non-cacheable responses. Details appropriate response codes (200 OK, 202 Accepted, 204 No Content) and the behavior of repeated calls (404 Not Found). Provides a typical example URI for deletion. ```APIDOC HTTP DELETE http://www.appdomain.com/users/123 ``` -------------------------------- ### OAuth 2.0 Example HTTP Error Redirect Response Source: https://tools.ietf.org/html/rfc6749 An example HTTP 302 Found response demonstrating how an authorization server redirects the user-agent to the client's callback URI with error parameters in the fragment, indicating an access denied scenario and including the state parameter. ```HTTP HTTP/1.1 302 Found Location: https://client.example.com/cb#error=access_denied&state=xyz ``` -------------------------------- ### HTTP DELETE Request URI Examples Source: https://restfulapi.net/http-methods/ Illustrates common URI patterns for HTTP DELETE requests, showing how to delete a specific user or a sub-resource like an account associated with a user. ```HTTP HTTP DELETE http://www.appdomain.com/users/123 HTTP DELETE http://www.appdomain.com/users/123/accounts/456 ``` -------------------------------- ### Example JSON Error Response for ProblemDetails Source: https://context7_llms Illustrates a typical JSON payload for an API error response following the ProblemDetails specification. This example shows a 'Forbidden' (403) error due to insufficient credit, including type, title, status, detail, and instance fields, demonstrating the structure for client-side error handling. ```JSON { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### OAuth 2.0 Example HTTP Access Token Request (Password Grant) Source: https://tools.ietf.org/html/rfc6749 An example HTTP POST request to the token endpoint for obtaining an access token using the Resource Owner Password Credentials Grant. It demonstrates the `application/x-www-form-urlencoded` content type, Basic authentication, and the required `grant_type`, `username`, and `password` parameters. ```HTTP POST /token HTTP/1.1 Host: server.example.com Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Content-Type: application/x-www-form-urlencoded grant_type=password&username=johndoe&password=A3ddj3w ``` -------------------------------- ### Example HTTP Redirect for OAuth 2.0 Authorization Error Source: https://tools.ietf.org/html/rfc6749 An example HTTP 302 Found response showing how an authorization server redirects the user-agent with error parameters in the Location header. ```HTTP HTTP/1.1 302 Found Location: https://client.example.com/cb?error=access_denied&state=xyz ``` -------------------------------- ### BigChange API Standard HTTP Verb Usage Source: https://context7_llms This documentation provides a reference for the standard HTTP verbs used by the BigChange REST API, detailing their specific purposes for interacting with resources. It clarifies when to use GET for fetching, POST for creating, PUT for full updates, PATCH for partial updates, and DELETE for removing resources. ```APIDOC BigChange API HTTP Verbs: - GET: Purpose: Fetch a specific or a collection of resources. - POST: Purpose: Create a new resource. Note: Successful responses provide 'id' in body and 'location' header. - PUT: Purpose: Update an existing resource (full replacement). - PATCH: Purpose: Partially update an existing resource. - DELETE: Purpose: Delete resources. ``` -------------------------------- ### Example OAuth 2.0 Successful Token Redirect Source: https://tools.ietf.org/html/rfc6749 An example HTTP 302 Found response demonstrating a successful OAuth 2.0 access token redirect, including the access token, state, token type, and expiration time in the fragment component of the Location header. ```HTTP HTTP/1.1 302 Found Location: http://example.com/cb#access_token=2YotnFZFEjr1zCsicMWpAA &state=xyz&token_type=example&expires_in=3600 ``` -------------------------------- ### Example HTTP 302 Redirect for OAuth 2.0 Authorization Response Source: https://tools.ietf.org/html/rfc6749 Provides an example of the HTTP 302 Found response sent by the authorization server to redirect the user-agent back to the client's redirection URI. This response includes the authorization 'code' and 'state' parameters in the 'Location' header. ```HTTP HTTP/1.1 302 Found Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA &state=xyz ``` -------------------------------- ### Initialize Docusaurus Theme and Data Attributes Source: https://developers.bigchange.com/docs/rest/api-reference/delete-a-job-worksheet-answer/ This script initializes the Docusaurus site's theme by checking for a 'docusaurus-theme' URL parameter or a 'theme' item in local storage, defaulting to 'light' if neither is found. It also iterates through URL parameters, applying any starting with 'docusaurus-data-' as 'data-' attributes to the HTML document's root element. ```JavaScript !function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() ``` -------------------------------- ### Example OAuth 2.0 Bearer Token Protected Resource Access Source: https://tools.ietf.org/html/rfc6749 Demonstrates how a client accesses a protected resource by presenting an OAuth 2.0 bearer access token. The token is included in the 'Authorization' HTTP request header, following the 'Bearer' scheme. ```HTTP GET /resource/1 HTTP/1.1 Host: example.com Authorization: Bearer mF_9.B5f-4.1JqM ``` -------------------------------- ### OAuth 2.0 Authorization Code Grant Token Request Example Source: https://tools.ietf.org/html/rfc6749 Demonstrates an HTTP POST request to an OAuth 2.0 token endpoint to exchange an authorization code for an access token. This example includes Host, Authorization (Basic client authentication), and Content-Type headers, along with URL-encoded form parameters such as grant_type, code, and redirect_uri. ```HTTP Host: server.example.com Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Content-Type: application/x-www-form-urlencoded grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb ``` -------------------------------- ### OAuth 2.0 Successful Access Token Response Example Source: https://tools.ietf.org/html/rfc6749 Illustrates a successful HTTP 200 OK response from an OAuth 2.0 authorization server after a valid access token request. The response includes standard HTTP headers and a JSON body containing the access_token, token_type, expires_in, refresh_token, and an example_parameter. ```HTTP HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Cache-Control: no-store Pragma: no-cache { "access_token":"2YotnFZFEjr1zCsicMWpAA", "token_type":"example", "expires_in":3600, "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", "example_parameter":"example_value" } ``` -------------------------------- ### Initialize Website Prefetching, UI, and Plugin Configurations in JavaScript Source: https://restfulapi.net/versioning/ This JavaScript code initializes client-side functionalities for a website, including prefetching resources based on URL patterns, tracking user input methods (mouse or keyboard), and setting up extensive configurations for WordPress components. It defines parameters for code syntax highlighting (Prism), navigation menus, search bars, back-to-top scrolling, and a comprehensive comment system (wpDiscuz) with various messages, validation rules, social login options, and real-time update settings. ```JavaScript [](# \"Scroll back to top\"){\"prefetch\":[{\"source\":\"document\",\"where\":{\"and\":[{\"href_matches\":\"\\/*\"},{\"not\":{\"href_matches\":[\"\\/wp-*.php\",\"\\/wp-admin\\/*\",\"\\/wp-content\\/uploads\\/*\",\"\\/wp-content\\/*\",\"\\/wp-content\\/plugins\\/*\",\"\\/wp-content\\/themes\\/generatepress_child\\/*\",\"\\/wp-content\\/themes\\/generatepress\\/*\",\"\\/*\\\\?(.+)\"]}},{\"not\":{\"selector_matches\":\"a ``` -------------------------------- ### Website Frontend Configuration and User Interaction Script Source: https://restfulapi.net/http-methods/ This JavaScript code block initializes various frontend settings for a WordPress website, including configurations for Prism.js, GeneratePress theme navigation, and the wpDiscuz comment plugin. It also includes a script to detect user input device (mouse vs. keyboard) by adding/removing a 'using-mouse' class on the body element based on pointerdown and keydown events. ```JavaScript {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/generatepress_child\/*","\/wp-content\/themes\/generatepress\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} !function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("pointerdown",(function(){e.classList.add("using-mouse")}),{passive:!0}),e.addEventListener("keydown",(function(){e.classList.remove("using-mouse")}),{passive:!0})}}(); var prism_settings = {"pluginUrl":"https:\/\/restfulapi.net\/wp-content\/plugins\/code-syntax-block\/"}; var generatepressMenu = {"toggleOpenedSubMenus":true,"openSubMenuLabel":"Open Sub-Menu","closeSubMenuLabel":"Close Sub-Menu"}; var generatepressNavSearch = {"open":"Open Search Bar","close":"Close Search Bar"}; var generatepressBackToTop = {"smooth":true}; var wpdiscuzAjaxObj = {"wc_hide_replies_text":"Hide Replies","wc_show_replies_text":"View Replies","wc_msg_required_fields":"Please fill out required fields","wc_invalid_field":"Some of field value is invalid","wc_error_empty_text":"please fill out this field to comment","wc_error_url_text":"url is invalid","wc_error_email_text":"email address is invalid","wc_invalid_captcha":"Invalid Captcha Code","wc_login_to_vote":"You Must Be Logged In To Vote","wc_deny_voting_from_same_ip":"You are not allowed to vote for this comment","wc_self_vote":"You cannot vote for your comment","wc_vote_only_one_time":"You've already voted for this comment","wc_voting_error":"Voting Error","wc_banned_user":"You are banned","wc_comment_edit_not_possible":"Sorry, this comment is no longer possible to edit","wc_comment_not_updated":"Sorry, the comment was not updated","wc_comment_not_edited":"You've not made any changes","wc_msg_input_min_length":"Input is too short","wc_msg_input_max_length":"Input is too long","wc_spoiler_title":"Spoiler Title","wc_cannot_rate_again":"You cannot rate again","wc_not_allowed_to_rate":"You're not allowed to rate here","wc_confirm_rate_edit":"Are you sure you want to edit your rate?","wc_follow_user":"Follow this user","wc_unfollow_user":"Unfollow this user","wc_follow_success":"You started following this comment author","wc_follow_canceled":"You stopped following this comment author.","wc_follow_email_confirm":"Please check your email and confirm the user following request.","wc_follow_email_confirm_fail":"Sorry, we couldn't send confirmation email.","wc_follow_login_to_follow":"Please login to follow users.","wc_follow_impossible":"We are sorry, but you can't follow this user.","wc_follow_not_added":"Following failed. Please try again later.","is_user_logged_in":"","commentListLoadType":"0","commentListUpdateType":"0","commentListUpdateTimer":"600","liveUpdateGuests":"0","wordpressThreadCommentsDepth":"5","wordpressIsPaginate":"","commentTextMaxLength":"0","replyTextMaxLength":"0","commentTextMinLength":"10","replyTextMinLength":"10","storeCommenterData":"100000","socialLoginAgreementCheckbox":"0","enableFbLogin":"0","fbUseOAuth2":"0","enableFbShare":"0","facebookAppID":"","facebookUseOAuth2":"0","enableGoogleLogin":"0","googleClientID":"","googleClientSecret":"","cookiehash":"a21cf746f837f71681edc9e7cee3e405","isLoadOnlyParentComments":"0","scrollToComment":"1","commentFormView":"collapsed","enableDropAnimation":"1","isNativeAjaxEnabled":"1","userInteractionCheck":"1","enableBubble":"0","bubbleLiveUpdate":"0","bubbleHintTimeout":"45","bubbleHintHideTimeout":"10","cookieHideBubbleHint":"wpdiscuz_hide_bubble_hint","bubbleHintShowOnce":"1","bubbleHintCookieExpires":"7","bubbleShowNewCommentMessage":"1","bubbleLocation":"content_left","firstLoadWithAjax":"1","wc_copied_to_clipboard":"Copied to ``` -------------------------------- ### Get Note Type API Success Response (200 OK) Source: https://context7_llms This snippet details the schema and an example JSON payload for a successful 200 OK response when retrieving a note type. It includes fields such as 'id', 'name', 'defaultOwnedByUserId', and 'createdAt'. ```APIDOC Schema: id int64 The unique identifier of the note type Example: 5514123 name string The name of the note type Example: Complaint defaultOwnedByUserId int64nullable The default owner for notes of this type Example: 5514123 createdAt date-time The UTC timestamp of when this note type was created Example: 2022-11-29T16:50:16.0000000+00:00 ``` ```JSON { "id": 5514123, "name": "Complaint", "defaultOwnedByUserId": 5514123, "createdAt": "2022-11-29T16:50:16.0000000+00:00" } ``` -------------------------------- ### HTTP 405 Method Not Allowed Status Code Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes Explains the 405 status code, indicating that a request method is not supported for the requested resource; for example, a GET request on a form that requires data via POST, or a PUT request on a read-only resource. ```APIDOC 405 Method Not Allowed A request method is not supported for the requested resource; for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource. ``` -------------------------------- ### Google Analytics Initialization Script Source: https://restfulapi.net/http-methods/ Standard JavaScript snippet for initializing Google Analytics, pushing data to the 'dataLayer' and configuring a specific GA tracking ID for website analytics. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-GKHN4ZGH3M'); ``` -------------------------------- ### Apply Docusaurus Data Attributes from URL Parameters in JavaScript Source: https://developers.bigchange.com/docs/rest/api-reference/get-a-note-type/ This JavaScript IIFE iterates through URL search parameters. For any parameter key starting with 'docusaurus-data-', it extracts the value and sets a corresponding `data-` attribute on the `` element. For example, 'docusaurus-data-foo=bar' would set `data-foo='bar'`. This allows dynamic configuration of Docusaurus components via URL. ```javascript !function(){ try{ const n=new URLSearchParams(window.location.search).entries(); for(var[t,e]of n) if(t.startsWith("docusaurus-data-")){ var a=t.replace("docusaurus-data-","data-"); document.documentElement.setAttribute(a,e) } }catch(t){} }() ``` -------------------------------- ### Cancel Job API Request Body Example Source: https://context7_llms An example of the JSON payload required for the 'Cancel Job' API request, detailing the 'reason' field. ```json { "reason": "Customer no longer requires the work" } ``` -------------------------------- ### Google Analytics and Breeze Prefetch Initialization Source: https://restfulapi.net/versioning/ Initializes global JavaScript variables for Breeze prefetching configuration, specifying local URL and an ignore list, and sets up Google Analytics tracking with the `gtag` function. ```JavaScript var breeze_prefetch = {"local_url":"https:\\\/\\/restfulapi.net","ignore_remote_prefetch":"1","ignore_list":["\\/ads.txt","wp-admin","wp-login.php"]}; window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-GKHN4ZGH3M'); ``` -------------------------------- ### Example JSON for 403 Forbidden Response Source: https://context7_llms An example JSON payload for a 403 Forbidden response, illustrating the 'ProblemDetails' structure with common error fields. ```JSON { "type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit", "status": 403, "detail": "Your current balance is 30, but that costs 50", "instance": "/account/12345/msgs/abc" } ``` -------------------------------- ### Get Note Type API Endpoint Definition Source: https://context7_llms Defines the HTTP GET endpoint for retrieving details of a single note type. This operation requires the 'notes:read' scope. ```http GET https://api.bigchange.com/v1/noteTypes/:noteTypeId ``` -------------------------------- ### Initialize Docusaurus Theme and Data Attributes Source: https://developers.bigchange.com/docs/rest/auth-proxy/get-an-access-token This JavaScript code initializes the Docusaurus site's theme by checking URL parameters ('docusaurus-theme') or local storage ('theme'), defaulting to 'light' if no preference is found. Additionally, it processes URL parameters prefixed with 'docusaurus-data-' and applies them as 'data-' attributes to the HTML document's root element. ```JavaScript !function(){ function t(t){document.documentElement.setAttribute("data-theme",t)} var e=function(){ try{return new URLSearchParams(window.location.search).get("docusaurus-theme")} catch(t){} }()|| function(){ try{return window.localStorage.getItem("theme")} catch(t){} }(); t(null!==e?e:"light") }(), function(){ try{ const n=new URLSearchParams(window.location.search).entries(); for(var\[t,e\]of n) if(t.startsWith("docusaurus-data-")){ var a=t.replace("docusaurus-data-","data-"); document.documentElement.setAttribute(a,e) } } catch(t){} }() ``` -------------------------------- ### General Website UI and Layout CSS Source: https://restfulapi.net/http-methods/ This snippet provides the core CSS for styling interactive elements such as text inputs, buttons, and navigation links, along with layout adjustments for different screen sizes. It defines colors, backgrounds, borders, and spacing, including specific rules for hover and focus states, and responsive media queries. ```CSS a:hover{color:var(--contrast-3);}.footer-bar .widget_nav_menu .current-menu-item a{color:var(--contrast-3);}input\[type="text"\]\,input\[type="email"\]\,input\[type="url"\]\,input\[type="password"\]\,input\[type="search"\]\,input\[type="tel"\]\,input\[type="number"\]\,textarea\,select{color:#666666;background-color:#fafafa;border-color:#cccccc;}input\[type="text"\]:focus\,input\[type="email"\]:focus\,input\[type="url"\]:focus\,input\[type="password"\]:focus\,input\[type="search"\]:focus\,input\[type="tel"\]:focus\,input\[type="number"\]:focus\,textarea:focus\,select:focus{color:#666666;background-color:#ffffff;border-color:#bfbfbf;}button\,html input\[type="button"\]\,input\[type="reset"\]\,input\[type="submit"\]\,a.button\,a.wp-block-button__link:not(.has-background){color:var(--base-3);background-color:var(--contrast);}button:hover\,html input\[type="button"\]:hover\,input\[type="reset"\]:hover\,input\[type="submit"\]:hover\,a.button:hover\,button:focus\,html input\[type="button"\]:focus\,input\[type="reset"\]:focus\,input\[type="submit"\]:focus\,a.button:focus\,a.wp-block-button__link:not(.has-background):active\,a.wp-block-button__link:not(.has-background):focus\,a.wp-block-button__link:not(.has-background):hover{color:var(--base-3);background-color:var(--contrast-3);}a.generate-back-to-top{background-color:rgba( 0,0,0,0.4 );color:#ffffff;}a.generate-back-to-top:hover\,a.generate-back-to-top:focus{background-color:rgba( 0,0,0,0.6 );color:#ffffff;}:root{--gp-search-modal-bg-color:var(--base-3);--gp-search-modal-text-color:var(--contrast);--gp-search-modal-overlay-bg-color:rgba(0,0,0,0.2);}@media (max-width: 768px){.main-navigation .menu-bar-item:hover > a\, .main-navigation .menu-bar-item.sfHover > a{background:none;color:var(--contrast);}}.nav-below-header .main-navigation .inside-navigation.grid-container\, .nav-above-header .main-navigation .inside-navigation.grid-container{padding:0px 20px 0px 20px;}.site-main .wp-block-group__inner-container{padding:40px;}.separate-containers .paging-navigation{padding-top:20px;padding-bottom:20px;}.entry-content .alignwide\, body:not(.no-sidebar) .entry-content .alignfull{margin-left:-40px;width:calc(100% + 80px);max-width:calc(100% + 80px);}.sidebar .widget\, .page-header\, .widget-area .main-navigation\, .site-main > \*{margin-bottom:40px;}.separate-containers .site-main{margin:40px;}.both-right .inside-left-sidebar\,.both-left .inside-left-sidebar{margin-right:20px;}.both-right .inside-right-sidebar\,.both-left .inside-right-sidebar{margin-left:20px;}.separate-containers .featured-image{margin-top:40px;}.separate-containers .inside-right-sidebar\, .separate-containers .inside-left-sidebar{margin-top:40px;margin-bottom:40px;}.rtl .menu-item-has-children .dropdown-menu-toggle{padding-left:20px;}.rtl .main-navigation .main-nav ul li.menu-item-has-children > a{padding-right:20px;}.widget-area .widget{padding:10px 20px 25px 20px;}.footer-widgets-container{padding:60px 40px 60px 40px;}.inside-site-info{padding:40px 20px 40px 20px;}@media (max-width:768px){.separate-containers .inside-article\, .separate-containers .comments-area\, .separate-containers .page-header\, .separate-containers .paging-navigation\, .one-container .site-content\, .inside-page-header{padding:50px 20px 50px 20px;}.site-main .wp-block-group__inner-container{padding:50px 20px 50px 20px;}.inside-header{padding-right:25px;padding-left:25px;}.footer-widgets-container{padding-right:25px;padding-left:25px;}.inside-site-info{padding-right:10px;padding-left:10px;}.entry-content .alignwide\, body:not(.no-sidebar) .entry-content .alignfull{margin-left:-20px;width:calc(100% + 40px);max-width:calc(100% + 40px);}.one-container .site-main .paging-navigation{margin-bottom:40px;}}/* End cached CSS */.is-right-sidebar{width:25%;}.is-left-sidebar{width:15%;}.site-content .content-area{width:60%;}@media (max-width: 768px){.main-navigation .menu-toggle\,.sidebar-nav-mobile:not(#sticky-placeholder){display:block;}.main-navigation ul\,.gen-sidebar-nav\,.main-navigation:not(.slideout-navigation):not(.toggled) .main-nav > ul\,.has-inline-mobile-toggle #site-navigation .inside-navigation > \*:not(.navigation-search):not(.main-nav){display:none;}.nav-align-right .inside-navigation\,.nav-align-center .inside-navigation{justify-content:space-between;}.has-inline-mobile-toggle .mobile-menu-control-wrapper{display:flex;flex-wrap:wrap;}.has-inline-mobile-toggle .inside-header{flex-direction:row;text-align:left;flex-wrap:wrap;}.has-inline-mobile-toggle .header-widget\,.has-inline-mobile-toggle #site-navigation{flex-basis:100%;}.nav-float-left .has-inline-mobile-toggle #site-navigation{order:10;}} .dynamic-author-image-rounded{border-radius:100%;}.dynamic-featured-image\, .dynamic-author-image{vertical-align:middle;}.one-container.blog .dynamic-content-template:not(:last-child)\, .one-container.archive .dynamic-content-template:not(:last-child){padding-bottom:0px;}.dynamic-entry-excerpt > p:last-child{margin-bottom:0px;} .page-hero{background-color:rgba(34,34,34,0.5);c ``` -------------------------------- ### Docusaurus Client-Side Initialization Scripts Source: https://developers.bigchange.com/docs/rest/api-reference/get-a-note-type This snippet contains JavaScript functions used by Docusaurus for client-side initialization. It includes a function to insert a base URL issue banner, a script to manage the site's theme based on URL parameters or local storage, and another script to apply data attributes from URL parameters to the document's root element. ```JavaScript function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\\n
\\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",(function(){void 0===window.docusaurus&&insertBanner()})) ``` ```JavaScript !function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}() ``` ```JavaScript !function(){try{const n=new URLSearchParams(window.location.search).entries();for(var\[t,e\]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() ``` -------------------------------- ### Website Layout and Container Styling CSS Source: https://restfulapi.net/http-methods/ CSS rules defining padding, width, and display properties for various 'gb-container' and 'gb-grid-wrapper' elements, including a hidden container and root variables for website layout. ```CSS .gb-container-862c047f > .gb-inside-container{padding-right:25px;padding-bottom:80px;padding-left:25px;}.gb-grid-wrapper > .gb-grid-column-862c047f{width:100%;}.gb-container-b83a6043 > .gb-inside-container{padding-top:40px;}.gb-grid-wrapper > .gb-grid-column-5d04ba48{width:100%;}.gb-container-efa2e9db{width:100%;display:none !important;}.gb-grid-wrapper > .gb-grid-column-efa2e9db{width:100%;}:root{--gb-container-width:2000px;}.gb-container .wp-block-image img{vertical-align:middle;}.gb-grid-wrapper .wp-block-image{margin-bottom:0;}.gb-highlight{background:none;}.gb-shape{line-height:0;}.gb-container-link{position:absolute;top:0;right:0;bottom:0;left:0;z-index:99;} ``` -------------------------------- ### Get Note Type API Request Parameters Source: https://context7_llms Describes the required path and header parameters for the 'Get Note Type' API, including 'noteTypeId' and 'Customer-Id', along with their types and constraints. ```APIDOC Path Parameters: noteTypeId: int64required Possible values: >= 1 The unique identifer of the note type Header Parameters: Customer-Id: int64required The customer identifier ``` -------------------------------- ### Overview of Web Interfaces, Protocols, and Server APIs Source: https://en.wikipedia.org/wiki/Representational_State_Transfer Comprehensive documentation outlining various web interfaces, server-side protocols (like HTTP, CGI, WebSocket), server application programming interfaces (e.g., Jakarta Servlet, Python WSGI), Apache modules, and related web architecture topics. ```APIDOC Web interfaces Web API Server-side Protocols HTTP v2 v3 Encryption (HTTPS) WebDAV CGI (Common Gateway Interface) SCGI (Simple Common Gateway Interface) FCGI (FastCGI) AJP (Apache JServ Protocol) WSRP (Web Services for Remote Portlets) WebSocket Server APIs C NSAPI (Netscape Server Application Programming Interface) C ASAPI (Apache HTTP Server) C ISAPI (Internet Server Application Programming Interface) COM ASP (Active Server Pages) Jakarta Servlet container (Web container) CLI OWIN (Open Web Interface for .NET) ASP.NET Handler (HTTP handler) Python WSGI (Web Server Gateway Interface) Python ASGI (Asynchronous Server Gateway Interface) Ruby Rack (Rack (web server interface)) JavaScript JSGI Perl PSGI (Plack (software) PSGI) Portlet container (Java Portlet Specification) Apache modules mod_include (Server Side Includes) mod_jk mod_lisp mod_mono mod_parrot mod_perl mod_php (PHP) mod_proxy mod_python mod_wsgi mod_ruby Phusion Passenger Topics Web service vs. Web resource WOA (Web-oriented architecture) vs. ROA (Resource-oriented architecture) Open API Webhook Application server ``` -------------------------------- ### C# HTTP Client GET Request with Bearer Token Source: https://context7_llms Demonstrates how to make a GET request to the `/v1/noteTypes/:noteTypeId` endpoint using C# HttpClient, including setting Accept and Authorization headers with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.bigchange.com/v1/noteTypes/:noteTypeId"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer