{% 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 TASK


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

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

{{method._method.__doc__}}

Сигнатура:

{{ method.signature }}

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

curl -X POST -H "Content-Type: application/json" -d'{
    "jsonrpc": "2.0-fox",
    "access_token": null,
    "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() }}"
}' \
--cookie 'access_token={{request.cookies.access_token}}' \
{{ request.url }}
{% endfor %}
{% endfor %}