“rating” Resource Type#
Represents a rating as part of Vendor Rating Management in Business Central.
Note
For information about enabling APIs for Business Central, please refer to Enabling APIs for Dynamics 365 Business Central.
Methods#
Method | Return Type | Description |
---|---|---|
GET rating | rating | Gets a rating object. |
DELETE rating | none | Deletes a rating object. |
POST rating | rating | Creates a rating object. |
PATCH rating | rating | Updates an existing rating object. |
Navigation#
Navigation | Return Type | Description |
---|---|---|
ratingTypes | ratingTypes | Gets the rating types associated with the current rating. |
Properties#
Property | Type | Description |
---|---|---|
id | Guid | The unique ID of the rating. Non-editable. |
ratingTypeCode | String | Specifies the unique code of the associated rating type. |
code | String | Specifies the code for the respective classification. The code is unique for this rating type. |
description | String | Specifies the description of the respective classification. |
quantity | Decimal | Specifies the quantity that applies to vendor rating in the subsequent processes with respect to the rating reference date that has been set up. |
defaultPoints | Decimal | Specifies the score assigned to this vendor rating. Note When the points are entered, the system will automatically create a row for the scored points in the "Rating Points" table. |
JSON Representation#
The following code shows a JSON representation of the rating resource.
{
"id": "GUID",
"ratingTypeCode": "string",
"code": "string",
"description": "string",
"quantity": "decimal",
"defaultPoints": "decimal"
}
HTTP Requests#
Get ratings#
Retrieves the properties and relationships of a rating object for Business Central.
HTTP Request#
Replace the URL prefix for Business Central depending on your environment, following the guideline.
GET businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Request Headers#
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Request Body#
For this method, no request body is required.
Response#
If successful, this method returns the 200 OK
response code and a rating object in the response body.
Example#
Request
The following code shows an example of the request.
GET https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Response The following code shows an example of the response.
{
"@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/ratings",
"value": [
{
"@odata.etag": "W/\"JzIwOzEyOTgxMTk5MDYxMjgwODUxOTEzMTswMDsn\"",
"id": "0cca6fe1-56ac-ed11-9eb2-c7df0d0ebfab",
"ratingTypeCode": "TEST",
"code": "A",
"description": "Good Test",
"quantity": 0,
"defaultPoints": 0
},
{
"@odata.etag": "W/\"JzIwOzEzOTg1MTcwODc5NTMzNzYzNjE4MTswMDsn\"",
"id": "45a29af9-56ac-ed11-9eb2-c7df0d0ebfab",
"ratingTypeCode": "TEST",
"code": "C",
"description": "Bad Test",
"quantity": 0,
"defaultPoints": 0
},
{
"@odata.etag": "W/\"JzIwOzE2MDA1MDkyOTI5MDc1MTU5Nzc4MTswMDsn\"",
"id": "e5a9c453-60ac-ed11-9eb2-c7df0d0ebfab",
"ratingTypeCode": "TEST",
"code": "B",
"description": "Intermediate Test",
"quantity": 0,
"defaultPoints": 0
}
]
}
Delete ratings#
Deletes a rating from Business Central.
HTTP Request#
Replace the URL prefix for Business Central depending on your environment, following the guideline.
DELETE businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Request Headers#
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
If-Match | Required. If this request header is included and the eTag provided does not match the current tag of the rating, the rating will not be updated. |
Request Body#
For this method, no request body is required.
Response#
If successful, this method returns the 204 No Content
response code and deletes the rating. Nothing will be returned in the response body.
Example#
Request
The following code shows an example of the request.
DELETE https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Response
The following code shows an example of the response.
HTTP/1.1 204 No Content
Create ratings#
Creates a rating in Business Central.
HTTP Request#
Replace the URL prefix for Business Central depending on your environment, following the guideline.
POST businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Request Headers#
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Content-Type | application/json |
If-Match | Required. If this request header is included and the eTag provided does not match the current tag of the rating, the rating will not be updated. |
Request Body#
In the request body, supply a JSON representation of a rating object.
Response#
If successful, this method returns the 201 Created
response code and a rating object in the response body.
Example#
Request
The following code shows an example of the request.
POST https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/ratings
Content-type: application/json
{
"ratingTypeCode": "TEST",
"code": "D",
"description": "Ultra Bad Test",
"quantity": 0,
"defaultPoints": 5
}
Response The following code shows an example of the response.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/$metadata#companies({id}})/ratings/$entity",
"@odata.etag": "W/\"JzIwOzE0ODg1Mjc3NTk0MTA5Mzc3MTQ1MTswMDsn\"",
"id": "a6a25917-64ac-ed11-9eb2-c7df0d0ebfab",
"ratingTypeCode": "TEST",
"code": "D",
"description": "Ultra Bad Test",
"quantity": 0,
"defaultPoints": 5
}
Update ratings#
Updates the properties of a rating object for Business Central.
HTTP Request#
Replace the URL prefix for Business Central depending on your environment, following the guideline.
PATCH businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Request Headers#
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Content-Type | application/json |
If-Match | Required. If this request header is included and the eTag provided does not match the current tag of the rating, the rating will not be updated. |
Request Body#
In the request body, supply the values for the fields to be updated. Existing properties that are not included in the request body will maintain their previous values or will be recalculated based on the changes made to other property values. For optimum performance, do not include existing values that have not changed.
Response#
If successful, this method returns the 200 OK
response code and an updated rating object in the response body.
Example#
Request
The following code shows an example of the request.
PATCH https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/ratings({id})
Content-type: application/json
{
"description": "Super Ultra Bad Test"
}
Response The following code shows an example of the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/$metadata#companies({id}})/ratings/$entity",
"@odata.etag": "W/\"JzIwOzE0ODg1MjgxODIzMjM4NzQwMDc3MTswMDsn\"",
"id": "a6a25917-64ac-ed11-9eb2-c7df0d0ebfab",
"ratingTypeCode": "TEST",
"code": "D",
"description": "Super Ultra Bad Test",
"quantity": 0,
"defaultPoints": 5
}