{"id":16257668,"url":"https://github.com/decipher/token_replace_ajax","last_synced_at":"2025-04-08T13:43:13.023Z","repository":{"id":35941831,"uuid":"40230602","full_name":"Decipher/token_replace_ajax","owner":"Decipher","description":"https://www.drupal.org/project/token_replace_ajax","archived":false,"fork":false,"pushed_at":"2023-12-15T08:49:19.000Z","size":18,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"8.x-1.x","last_synced_at":"2025-02-14T09:57:29.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Decipher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-05T07:12:08.000Z","updated_at":"2015-08-05T07:16:10.000Z","dependencies_parsed_at":"2023-12-15T09:51:18.162Z","dependency_job_id":null,"html_url":"https://github.com/Decipher/token_replace_ajax","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decipher%2Ftoken_replace_ajax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decipher%2Ftoken_replace_ajax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decipher%2Ftoken_replace_ajax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decipher%2Ftoken_replace_ajax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decipher","download_url":"https://codeload.github.com/Decipher/token_replace_ajax/tar.gz/refs/heads/8.x-1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247852869,"owners_count":21007029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T16:00:19.622Z","updated_at":"2025-04-08T13:43:12.999Z","avatar_url":"https://github.com/Decipher.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Token replace AJAX\n\n[![Build Status](https://travis-ci.org/Decipher/token_replace_ajax.svg)](https://travis-ci.org/Decipher/token_replace_ajax)\n\nThe Token replace AJAX module adds the ability to process individual tokens via\nan AJAX callback. It is primarily a developer utility, built for the purpose of\noffloading common functionality from other modules.\n\n\n\n## Usage\n\nThe Token replace AJAX module is essentially a very basic REST API with only one\nmethod:\n\n\n\n### token_replace/ajax/:token\n\nReturns the token, replacement and any Drupal messages as a JSON object.\n\n\n#### Parameters\n\n- **:token**\n\n    The token you wish to process in a standard token format.\n \n    **Example:** [node:title]\n  \n  \n- **entity_type** _(optional)_\n\n    An entity type to be used for the token data.\n    \n    **Example:** node\n    \n\n- **entity_id** _(optional)_\n\n    An entity id to be used for the token data.\n    \n    **Example:** 1\n\n\n- **key** _(optional)_\n\n    An authorisation key for the Token being replaced, generated by the\n    token_replace_ajax_access_key function.\n    \n    Only required if the user does not have the appropriate permission (access\n    token_replace_ajax callback).\n\n\n\n#### Example Request\n\n```GET token_replace/ajax/[node:title]?entity_type=node\u0026entity_id=1```\n\n#### Example Result\n\n```\n{\n  \"token\": \"[node:title]\",\n  \"value\": \"Node 1\",\n  \"messages\": {\n    \"data\": [],\n    \"html\": \"\"\n  }\n}\n```\n\n\n## Advanced usage\n\nYou can also POST an entity form to the endpoint (excluding the entity_type and\nentity_id parameters) and the module will create a dummy entity as the token\ndata.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecipher%2Ftoken_replace_ajax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecipher%2Ftoken_replace_ajax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecipher%2Ftoken_replace_ajax/lists"}