Get a specific template

@param string $template_id template id
@param string $version_id optional version id to get template version

@return array API response object
971313
public function get_template($template_id, $version_id = null){
        $endpoint = "templates/" . $template_id;

        if($version_id){
            $endpoint .= "/versions/" . $version_id;
        }

        return $this->api_request($endpoint, self::HTTP_GET);
    }
53862
public function getMethod($routeId, $version, $method)
    {
        if ($version == '*' || empty($version)) {
            $version = $this->methodTable->getLatestVersion($routeId);
        } else {
            $version = $this->methodTable->getVersion($routeId, $version);
        }

        if (empty($version)) {
            throw new StatusCode\UnsupportedMediaTypeException('Version does not exist');
        }

        return $this->methodTable->getMethod($routeId, $version, $method);
    }
754575
public function apiAddTemplate($template_id_short)
    {
        if (!is_string($template_id_short)) {
            $this->setError('参数错误');

            return false;
        }

        $queryStr = [
            'template_id_short' => $template_id_short,
        ];

        $res = $this->_post('api_add_template', $queryStr);

        return $res;
    }
877518
public function versionAction()
    {
        $this->assign('version', Samurai::getVersion());
        $this->assign('state', Samurai::getState());
        return self::VIEW_TEMPLATE;
    }
1045654
public function getTemplate($key, $language_id)
    {
        if ($template = EmailTemplateTranslation::findOne([
            'template_id' => EmailTemplate::getIdByKey($key),
            'language_id' => $language_id
        ])) {
            return Template::buildTemplate($template);
        }

        return null;
    }
370198
def get_templates(self, id_or_uri, start=0, count=-1, filter='', query='', sort=''):
        
        uri = self._client.build_uri(id_or_uri) + "/templates"
        return self._client.get(self._client.build_query_uri(start=start, count=count, filter=filter,
                                                             query=query, sort=sort, uri=uri))
909057
public function getTriggerByTemplate($template, $trigger_id = null) {
        $data = [ ];
        $data['template'] = $template;
        if (!is_null($trigger_id)) {
            $data['trigger_id'] = $trigger_id;
        }

        $result = $this->apiGet('trigger', $data);
        return $result;
    }
336037
def get_template_schema(template_id, opts = {})
      data, _status_code, _headers = get_template_schema_with_http_info(template_id, opts)
      data
    end
134893
@RequestMapping(value = "branches/{branchId}/template/instance", method = RequestMethod.GET)
    public TemplateInstance getTemplateInstance(@PathVariable ID branchId) {
        return branchTemplateService.getTemplateInstance(branchId)
                .orElseThrow(() -> new BranchNotTemplateInstanceException(branchId));
    }
493744
public function getDeliverTemplate($templateId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_DELIVERY_TEMPLATE_ID_GET_PREFIX, [
            'template_id' => $templateId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['template_info'] : false;
    }
930126
public function getModelVersionById($modelId, $versionId)
    {
        $modelResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('models/%s/versions/%s', $modelId, $versionId))
        );

        if (isset($modelResult['model_version'])) {
            $modelVersion = new ModelVersion($modelResult['model_version']);
        } else {
            throw new \Exception('Model Versions Not Found');
        }

        return $modelVersion;
    }
209458
public static function read_template($id) {
        static::require_enabled();
        $template = new template($id);
        $context = $template->get_context();

        // First we do a permissions check.
        if (!$template->can_read()) {
             throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                'nopermissions', '');
        }

        // OK - all set.
        return $template;
    }
902391
public function mediatemplate($id)
    {
        $template = $this->templateManager->find($id);

        if (!$template) {
            return [];
        }

        return $template->getParameters();
    }
112582
public function addTemplate($tpl_id)
    {
        $url = "https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['template_id_short' => $tpl_id]);
    }
1328182
public function rollbackToVersion($versionNumber): Template
    {
        $versionNumber = $versionNumber instanceof VersionNumber
            ? $versionNumber
            : VersionNumber::fromValue($versionNumber);

        $response = $this->client->rollbackToVersion($versionNumber);

        return Template::fromResponse($response);
    }
1132712
public function setTemplateId($template_id)
    {
        if (!($template_id instanceof TemplateId)) {
            $template_id = new TemplateId($template_id);
        }

        $this->template_id = $template_id;
    }
53121
def getTemplate(self, uri, meta=None):
        """"""

        if not meta:

            metaKey = self.cacheKey + '_templatesmeta_cache_' + uri

            meta = cache.get(metaKey, None)

            if not meta:
                meta = self.getMeta(uri)
                cache.set(metaKey, meta, 15)

        if not meta:  # No meta, can return a template
            return None

        # Let's find the template in the cache
        action = urlparse(uri).path

        templateKey = self.cacheKey + '_templates_' + action + '_' + meta['template_tag']
        template = cache.get(templateKey, None)

        # Nothing found -> Retrieve it from the server and cache it
        if not template:

            r = self.doQuery('template/' + uri)

            if r.status_code == 200:  # Get the content if there is not problem. If there is, template will stay to None
                template = r.content

            cache.set(templateKey, template, None)  # None = Cache forever

        return template