API | Get profile by phone number

Richard_Bystrom

03-07-2019

Hey.

I am currently working on an integration using the ACS API. I have managed to figure out how to fetch profiles using the endpoint "/byEmail?email=" but now I also want to be able to use a phone number in case there is no email present. I simply tried using byPhone and byMobilePhone but to no avail. Is it possible to get profiles by phone number, and if so what would the request URL be?

Best regards,

Richard Byström.

Accepted Solutions (1)

Accepted Solutions (1)

ramon_bisswange

Employee

03-07-2019

There is no default filter for phone / mobile phone.

What you can do:

  • Create a custom resource extending the profile resource
  • Add a related filter definition with a paramter to search on phone and/or mobile phone
  • This will add a new endpoint to the API which you can use to filter on phone / mobile phone

Answers (7)

Answers (7)

ramon_bisswange

Employee

09-07-2019

The URL in the space is only here in the forum or do you have that as part of the actual call?

Normally you should not have a space there.

ramon_bisswange

Employee

08-07-2019

The byPhone extract looks ok.

I just did a test on my side with a custom filter and the extract is looking similar here and REST call is returning the filtered data.

So are you doing a GET request to following URL?

https://mc.adobe.io/{{tenant}}/campaign/profileAndServicesExt/profile/byPhone?phone_parameter=012345

ramon_bisswange

Employee

04-07-2019

If you follow the first link, you should see the info about using parameters.

Once created, you can click on "Metadate" link for the custom resource.

This has a reference to list all filters and there you should see the information on how the parameter is used

Richard_Bystrom

10-07-2019

I went and doublechecked the logs and ran it again - the space is not there in the request. I must have accidentally put it there when copy pasting.

Richard_Bystrom

08-07-2019

Hey. Sorry for the late reply but I've been struggling to figure out why I'm not getting it to work.

I have managed to create a filter definition and looking in metadata as advised to find the link to the filter definitions API. From there, I requested the JSON with all filter definitions. The resulting JSON in a readable format is a little too large to post here, so I'll put it in it's compact format and you can verify the contents in jsoneditoronline.org or similar:

{"byPhone":{"PKey":"x","category":"0150_profile","condition":{"condition":[{"PKey":"x","boolOperator":"AND","condition":[],"dateTypeAndPrecision":{"operator":"","precision":"","type":""},"desc":"","enabledIf":"","entityLabel":"","entityName":"","entityType":"","expr":"@mobilePhone = $(__FILTER_CTX__/@phone_parameter)","filterLabel":"","filterName":"","internalId":1726021991,"order":1,"setOperator":"","subQuery":{"conditionLink":{},"ctx":"","groupBy":{"node":[]},"having":{"condition":[]},"operation":"","orderBy":{"node":[]},"schema":"","select":{"node":[]},"where":{"condition":[],"ctx":"","displayFilter":"","filterName":""}},"xpath":""}],"ctx":"","displayFilter":"","filterName":"byPhone"},"data":"/rest/profileAndServicesExt/profile/byPhone?phone_parameter=$value","formType":"externalFragment","fragmentName":"component:cusFilterFormProfilePhone","label":"Phone","metadata":{"PKey":"","content":{"cusFilterProfilePhone":{"PKey":"x","apiName":"cusFilterProfilePhone","category":"","content":{"phone_parameter":{"PKey":"x","apiName":"phone_parameter","category":"","dataPolicy":"","desc":"","displayFormat":"","help":"","label":"Phone","lazyLoaded":false,"length":"","mandatory":false,"metadata":"attribute","privacy":"firstParty","queryable":true,"readOnly":false,"resName":"","resType":"uuid","sortable":true,"type":"string"}},"dataPolicy":"","desc":"","displayFormat":"","help":"","label":"","lazyLoaded":false,"length":"","mandatory":false,"metadata":"element","privacy":"firstParty","queryable":true,"readOnly":false,"resName":"","resType":"","sortable":true,"type":"item","unbound":false}},"label":"","mandatory":false,"name":"cusFilterProfilePhone","pkgStatus":"","readOnly":false,"type":"item"},"resName":"byPhone","webPage":"","webPageName":""}}

Now I don't know what this is *supposed* to look like, but comparing to the native byEmail API I don't see any particular differences that would seem to affect the function. In any case, when running a get request to this API I simply get 25 results not related to the parameter included in the request. So obviously I did *something* wrong, but I haven't been able to find it myself. Do you have any idea what it might be?

Best regards,

Richard Byström.

Richard_Bystrom

04-07-2019

Thanks for your response! Are there any resources on how to configure the filter definition for it to take the value from the request URL?

I've been looking at these:

Configuring filter definition
Step 2: Publish the extension

Adobe Campaign Standard API

However I was unable to find details on how to configure the filter definitions. Do you know if there are any further guides or resources?

Best regards,

Richard Byström