User Tools

Site Tools


en:public:developer:template_system:tags:api:get_lookuplist_content

This is an old revision of the document!


<#get_lookuplist_content>

Use this function to retrieve the values of a lookup list

Parameters

Parameters are taken from tag (default) or from HTTP GET/Post

Name Mandatory Default Description
lookuplist_name Yes The ID of the lookup list
lookuplist_language No The language in with you want the label_* fields. Empty for all languages
with_schema No Add the schema of the fields in the result
output_format No REST JSON to retrieve response in JSON Format or REST to retrieve in REST Format
jsoncallback No Callback function to use in JSON Response Format

Error Codes

Code Description
119 Wrong Params

Example

<#get_lookuplist_content lookuplist_name=lead_type with_schema=1 lookuplist_language=fra>

will output in REST

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rsp stat="ok">
  <schema>
    <id>
      <type>7</type>
      <sub_type>0</sub_type>
      <length>2</length>
      <precision>0</precision>
      <scale>0</scale>
      <mandatory>1</mandatory>
      <primary>1</primary>
    </id>
    <label_fra>
      <type>37</type>
      <sub_type>0</sub_type>
      <length>50</length>
      <precision>-1</precision>
      <scale>0</scale>
      <mandatory>0</mandatory>
      <primary>0</primary>
    </label_fra>
  </schema>
  <lookupvalues>
    <lookupvalue>
      <id>1</id>
      <label_fra>Email</label_fra>
    </lookupvalue>
    <lookupvalue>
      <id>2</id>
      <label_fra>Web</label_fra>
    </lookupvalue>
    <lookupvalue>
      <id>3</id>
      <label_fra>Alerte</label_fra>
    </lookupvalue>
    <lookupvalue>
      <id>4</id>
      <label_fra>Telephone</label_fra>
    </lookupvalue>
  </lookupvalues>
</rsp>

And in JSON

{
    "stat": "ok",
    "schema": {
        "id": {
            "type": 7,
            "sub_type": 0,
            "length": 2,
            "precision": 0,
            "scale": 0,
            "mandatory": true,
            "primary": true
        },
        "label_fra": {
            "type": 37,
            "sub_type": 0,
            "length": 50,
            "precision": -1,
            "scale": 0,
            "mandatory": false,
            "primary": false
        }
    },
    "lookupvalues": [
        {
            "id": "1",
            "label_fra": "Email"
        },
        {
            "id": "2",
            "label_fra": "Web"
        },
        {
            "id": "3",
            "label_fra": "Alerte"
        },
        {
            "id": "4",
            "label_fra": "Telephone"
        }
    ]
}
en/public/developer/template_system/tags/api/get_lookuplist_content.1371818425.txt.gz · Last modified: 2013/06/21 16:40 by svanderclock