{% macro method_badge(method) %} {% if method.is_task %} CLASS TASK {% elif method.is_static_method %} STATIC METHOD {% elif method.is_class_method %} CLASS METHOD {% else %} OBJECT METHOD {% endif %} {% endmacro %}

CMF RPC API

{% for class_name, class in rpc.items() %}

class {{ class_name }}


{% for method_name, method in class.methods.items() %}

{{ method_badge(method) }} {{class_name}}.{{method_name}}

{{method._method.__doc__}}

Сигнатура:

{{ method.signature }}

Пример вызова:

curl '{{ request.url }}' -X POST -H "Content-Type: application/json" --data-raw '{
    "method": "{{class_name}}.{{method_name}}",
    "kwargs": {% if method.is_class_method %}{ {% if method._method.__doc__ and 'filter:' in method._method.__doc__ %}
        "filter": "*"{% endif %}{% if method._method.__doc__ and 'order_by:' in method._method.__doc__ %},
        "order_by": ["name"]{% endif %}
    }{% else %}{
        "id": 1
    }{% endif %},
    "callid": "{{ uuid4() }}",
    "jsonrpc": "2.2"
}' \
-H 'Cookie: access_token={{request.cookies.access_token}}'
{% endfor %}
{% endfor %}