Get the email addresses of opportunity contacts

Hello,

I would like to know if with api V4.1 is possible to get the email addresses of all contacts by give an opportunity name. I’m using curl

Thanks in advance

Hi,
I’m using get_entry_list in this example:

{
	"session": "{{sessionid}}",
	"module_name": "Opportunities",
	"query": "opportunities.id='myId'",
	"order_by": null,
	"offset": null,
	"select_fields": null,
	"link_name_to_fields_array": [
		{
			"name": "contacts",
			"value": [
				"id","email1"			
            ]
		}
	]
}

result:

{
    "result_count": 1,
    "total_count": "1",
    "next_offset": 1,
    "entry_list": [
        {
            "id": "myId",
            "module_name": "Opportunities",
            "name_value_list": {
                //removed: attributes from the opportunity itself
            }
        }
    ],
    "relationship_list": [
        {
            "link_list": [
                {
                    "name": "contacts",
                    "records": [
                        {
                            "link_value": {
                                "id": {
                                    "name": "id",
                                    "value": "someId"
                                },
                                "email1": {
                                    "name": "email1",
                                    "value": "test@example.com"
                                }
                            }
                        },
                        {
                            "link_value": {
                                "id": {
                                    "name": "id",
                                    "value": "someId2"
                                },
                                "email1": {
                                    "name": "email1",
                                    "value": "some@example.com"
                                }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

Hi, thanks for the response.

I’m trying exactly in this way:

curl
-s -q
-H “Content-Type: multipart/form-data”
https://$HOST/service/v4_1/rest.php
-F ‘method=get_entry_list’
-F ‘input_type=JSON’
-F ‘response_type=JSON’
-F ‘rest_data={“session”:"’${SESSION_ID}‘",“module_name”:“Opportunities”,“query”:“opportunities.id=‘004f9f54-322e-11e2-bc17-52540026304b’”,“order_by”:null,“offset”:null,“select_fields”:null,“link_name_to_fields_array”:[{“name”:“contacts”,“value”:[“id”,“email1”]}]}’

and I get:
{“name”:“Access Denied”,“number”:40,“description”:“You do not have access”}

Hi,
I would assume that your user (the user that the session belongs to) has insufficient rights to access the records. Did you test the same request with an admin-user (just for the sake of having it tested)?

Yes, I forgot to mention that I’m doing everything as admin user. I was able to do other queries with the same user.

Is there any news regarding this topic?

Thanks