Query a Codec Function
Function
Provides the function of querying codec functions.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v5/iot/{project_id}/product-functions
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Parameter description: project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_id |
No |
String |
Parameter description: resource space ID. This parameter is optional. If you have multiple resource spaces, you can specify this parameter to query codec functions in the specified resource space. If this parameter is not carried, codec functions in all resource spaces are queried. Value: The value can contain a maximum of 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
product_id |
Yes |
String |
Parameter description: unique ID of the product associated with the device. The value is allocated by the platform after the product is created. For details, see Create a Product. Value: The value can contain a maximum of 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Instance-Id |
No |
String |
Parameter description: instance ID. Unique identifier of each instance in the physical multi-tenant scenario. Mandatory for professional editions and recommended in other cases. Log in to the IoTDA console and choose Overview in the navigation pane to view the instance ID. For details, see Viewing Instance Details. |
X-Auth-Token |
No |
String |
Parameter description: user token. You can obtain the token by calling the IAM API Obtaining a User Token Through Password Authentication. In the returned response header, X-Subject-Token is the desired user token. For details about how to obtain the token, see Token Authentication. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
product_functions |
Array of FunctionDTO objects |
Parameter description: list of codec functions. |
count |
Long |
Parameter description: total number of records that meet the query conditions. |
Parameter |
Type |
Description |
---|---|---|
app_id |
String |
Parameter description: resource space ID. This parameter is optional. If you have multiple resource spaces, you can specify this parameter to query codec functions in the specified resource space. If this parameter is not carried, codec functions in all resource spaces are queried. Value: The value can contain a maximum of 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
product_id |
String |
Parameter description: unique ID of the product associated with the device. The value is allocated by the platform after the product is created. For details, see Create a Product. Value: The value can contain a maximum of 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
function_id |
String |
Parameter description: function ID, which is a unique ID generated after a function is configured for a product. Value: The value can contain a maximum of 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
urn |
String |
Parameter description: uniform resource name (URN) of the function associated with the product. Value: The value can contain a maximum of 128 characters. Only letters, digits, underscores (_), hyphens (-), and colons (:) are allowed. |
description |
String |
Parameter description: description of a codec function. Value: The value can contain a maximum of 128 characters. Only letters, digits, and special characters (_?'#().,&%@!-) are allowed. |
create_time |
String |
Parameter description: time when a product function was created. Format: yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z. |
Example Requests
Queries a codec function.
GET https://{endpoint}/v5/iot/{project_id}/product-functions
Example Responses
Status code: 200
OK
{ "product_functions" : [ { "app_id" : "0ab87ceecbfc49acbcc8d5acdef3c68c", "product_id" : "5ba24f5ebbe8f56f5a14f605", "function_id" : "9739d740-4da1-46e1-8075-77145265cd92", "urn" : "urn:fss:cn-north-4:46b6f338fc3445b8846c71dfb1fbd9e8:function:java:codecFunc", "description" : "xxx", "create_time" : "20190303T081011Z" } ], "count" : 1 }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot