Back to Collection Items
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim http As New ChilkatHttp
Dim success As Long
' Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>"
Dim sbResponseBody As New ChilkatStringBuilder
success = http.QuickGetSb("https://domain.com/crm/v2.1/Quotes/{{record_id}}/actions/share",sbResponseBody)
If (success = 0) Then
Debug.Print http.LastErrorText
Exit Sub
End If
Dim jResp As New ChilkatJsonObject
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0
Debug.Print "Response Body:"
Debug.Print jResp.Emit()
Dim respStatusCode As Long
respStatusCode = http.LastStatus
Debug.Print "Response Status Code = " & respStatusCode
If (respStatusCode >= 400) Then
Debug.Print "Response Header:"
Debug.Print http.LastHeader
Debug.Print "Failed."
Exit Sub
End If
' Sample JSON response:
' (Sample code for parsing the JSON response is shown below)
' {
' "share": [
' {
' "share_related_records": false,
' "shared_through": {
' "module": {
' "name": "Quotes",
' "id": "4150868000000002219"
' },
' "id": "4150868000004795007"
' },
' "permission": "full_access",
' "user": {
' "full_name": "User 2",
' "id": "4150868000001199001",
' "zuid": "705903469"
' }
' },
' {
' "share_related_records": false,
' "shared_through": {
' "module": {
' "name": "Quotes",
' "id": "4150868000000002219"
' },
' "id": "4150868000004795007"
' },
' "permission": "full_access",
' "user": {
' "full_name": "User 3",
' "id": "4150868000001248015",
' "zuid": "707001331"
' }
' }
' ]
' }
' Sample code for parsing the JSON response...
' Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Dim share_related_records As Long
Dim Name As String
Dim Id As String
Dim shared_throughId As String
Dim permission As String
Dim Full_name As String
Dim userId As String
Dim Zuid As String
Dim i As Long
i = 0
Dim count_i As Long
count_i = jResp.SizeOfArray("share")
Do While i < count_i
jResp.I = i
share_related_records = jResp.BoolOf("share[i].share_related_records")
Name = jResp.StringOf("share[i].shared_through.module.name")
Id = jResp.StringOf("share[i].shared_through.module.id")
shared_throughId = jResp.StringOf("share[i].shared_through.id")
permission = jResp.StringOf("share[i].permission")
Full_name = jResp.StringOf("share[i].user.full_name")
userId = jResp.StringOf("share[i].user.id")
Zuid = jResp.StringOf("share[i].user.zuid")
i = i + 1
Loop
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
https://domain.com/crm/v2.1/Quotes/{{record_id}}/actions/share
Postman Collection Item JSON
{
"name": "Quotes",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access-token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/{{record_id}}/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"{{record_id}}",
"actions",
"share"
]
},
"description": "To get the details of a shared record in the Quotes module."
},
"response": [
{
"name": "SUCCESS RESPONSE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"4150868000004795007",
"actions",
"share"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:38:15 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "481"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-10T17:05:19+05:30"
},
{
"key": "clientVersion",
"value": "4016246"
},
{
"key": "clientsubVersion",
"value": "59f8474ad0046d6a2f6204e0448818d0"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000"
}
],
"cookie": [
],
"body": "{\n \"share\": [\n {\n \"share_related_records\": false,\n \"shared_through\": {\n \"module\": {\n \"name\": \"Quotes\",\n \"id\": \"4150868000000002219\"\n },\n \"id\": \"4150868000004795007\"\n },\n \"permission\": \"full_access\",\n \"user\": {\n \"full_name\": \"User 2\",\n \"id\": \"4150868000001199001\",\n \"zuid\": \"705903469\"\n }\n },\n {\n \"share_related_records\": false,\n \"shared_through\": {\n \"module\": {\n \"name\": \"Quotes\",\n \"id\": \"4150868000000002219\"\n },\n \"id\": \"4150868000004795007\"\n },\n \"permission\": \"full_access\",\n \"user\": {\n \"full_name\": \"User 3\",\n \"id\": \"4150868000001248015\",\n \"zuid\": \"707001331\"\n }\n }\n ]\n}"
},
{
"name": "INVALID_URL_PATTERN",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/action/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"4150868000004795007",
"action",
"share"
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:39:00 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "131"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-10T17:05:19+05:30"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_URL_PATTERN\",\n \"details\": {},\n \"message\": \"Please check if the URL trying to access is a correct one\",\n \"status\": \"error\"\n}"
},
{
"name": "INVALID_DATA (record ID)",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/415086800000479500/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"415086800000479500",
"actions",
"share"
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:39:17 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "115"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-10T17:05:19+05:30"
},
{
"key": "clientVersion",
"value": "4016246"
},
{
"key": "clientsubVersion",
"value": "59f8474ad0046d6a2f6204e0448818d0"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_DATA\",\n \"details\": {\n \"entityId\": \"415086800000479500\"\n },\n \"message\": \"ENTITY_ID_INVALID\",\n \"status\": \"error\"\n}"
},
{
"name": "INVALID_REQUEST_METHOD",
"originalRequest": {
"method": "COPY",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"4150868000004795007",
"actions",
"share"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:41:33 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "124"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "X-Frame-Options",
"value": "deny"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_REQUEST_METHOD\",\n \"details\": {},\n \"message\": \"The http request method type is not a valid one\",\n \"status\": \"error\"\n}"
},
{
"name": "AUTHENTICATION_FAILURE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"4150868000004795007",
"actions",
"share"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:41:50 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "98"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Download-Options",
"value": "noopen"
}
],
"cookie": [
],
"body": "{\n \"code\": \"AUTHENTICATION_FAILURE\",\n \"details\": {},\n \"message\": \"Authentication failed\",\n \"status\": \"error\"\n}"
},
{
"name": "INVALID_MODULE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quote/4150868000004795007/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quote",
"4150868000004795007",
"actions",
"share"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 10 May 2021 10:42:26 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "133"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-10T17:05:19+05:30"
},
{
"key": "clientVersion",
"value": "4016246"
},
{
"key": "clientsubVersion",
"value": "59f8474ad0046d6a2f6204e0448818d0"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_MODULE\",\n \"details\": {\n \"resource_path_index\": 0\n },\n \"message\": \"the module name given seems to be invalid\",\n \"status\": \"error\"\n}"
},
{
"name": "OAUTH_SCOPE_MISMATCH",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2.1/Quotes/{{record_id}}/actions/share",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Quotes",
"{{record_id}}",
"actions",
"share"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Thu, 13 May 2021 08:18:32 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "113"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Download-Options",
"value": "noopen"
}
],
"cookie": [
],
"body": "{\n \"code\": \"OAUTH_SCOPE_MISMATCH\",\n \"details\": {},\n \"message\": \"invalid oauth scope to access this URL\",\n \"status\": \"error\"\n}"
}
]
}