Phone number obligatory on new contact entry - google-api

I want to send a POST request on Google Contacts API. It works well at the moment.
But I wonder why I get a 400 Bad Request Error if I don't specify a phone number.
<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
<error>
<domain>GData</domain>
<code>invalid</code>
<internalReason>Phone number must not be empty</internalReason>
</error>
</errors>
If someone knows if I can bypass it ?
Notice that when you add a contact on Google Contacts, there's not this restriction.

You're getting that error because it's stated in the docs that these extension elements need to be provided a rel attribute or a label attribute:
In the Contacts Data API, several elements are slightly more
restrictive than indicated in the documentation for the Contact kind.
In particular, a client must supply either a rel attribute or a label
attribute, but not both, for the following elements:
gd:email gd:im gd:organization gd:phoneNumber gd:postalAddress
In short, you really need to provide the phone number.

Related

Send additional data to Workday

I am working on sending some additional data for a workday using this endpoint Edit_Worker_Additional_Data. However, it lacks the documentation as what type of data they are expecting, hence, I am getting validation errors. I have tried various combinations but all in vain.
I took some guidance from this question but getting cus namespace error as I don't know where and how he initialized that namespace. Data for the custom field that I want to send:
Custom List
T-Shirt Sizes
Custom Field Type Name
T-Shirt Sizes
Web Service Alias
tShirtSize
List Value Name
Web Service Alias
M - Xs
mXs
M - S
Ms
Given below is the XML request body that I am sending
<soapenv:Body>
<bsvc:Edit_Worker_Additional_Data_Request
xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v38.1">
<!-- Optional: -->
<bsvc:Business_Process_Parameters>
<!-- Optional: -->
<bsvc:Auto_Complete>true</bsvc:Auto_Complete>
<!-- Optional: -->
<bsvc:Run_Now>true</bsvc:Run_Now>
</bsvc:Business_Process_Parameters>
<bsvc:Worker_Custom_Object_Data>
<bsvc:Effective_Date>2022-11-18</bsvc:Effective_Date>
<bsvc:Worker_Reference bsvc:Descriptor="string">
<!-- Zero or more repetitions: -->
<bsvc:ID bsvc:type="Employee_ID">3671</bsvc:ID>
</bsvc:Worker_Reference>
<bsvc:Business_Object_Additional_Data>
<!-- You may enter ANY elements at this point -->
<bsvc:tShirtSizes>
<bsvc:tShirtSizesField>mXs</bsvc:tShirtSizesField>
</bsvc:tShirtSizes>
</bsvc:Business_Object_Additional_Data>
</bsvc:Worker_Custom_Object_Data>
</bsvc:Edit_Worker_Additional_Data_Request>
</soapenv:Body>
Following are the validation errors that I am getting with different combinations
Invalid Subelement tShirtSizes-urn:com.workday/bsvc for element Effective_Dated_Web_Service_Additional_Data
Invalid Subelement T-Shirt_Sizes-urn:com.workday/bsvc for element Effective_Dated_Web_Service_Additional_Data
I'm not sure if you've already got an answer. It looks like you need the Custom Object name Web Service Alias and the Custom Field Web Service Alias for T Shirt and T Shirt Sizes. Assuming T Shirt is a custom object for the Worker Object Extended. This can be found by someone with appropriate security access in the Workday environment you are trying to make this for. Looks like this is just a custom list which doesn't really provide the context we are looking for.
In Workday search for Custom Object Definitions
Search By Business Process Type
Select Edit Worker Additional Data Event
At this point you may have one or more results (most likely one), but based on context it should be appended by (Effective Dated)
From here one should find what you are looking for.
Here is an example of what this looks like for another custom object
Workday Custom Object Picture
Once you get this information it could be something like this:
<bsvc:Custom Object's Web Service Alias>
<bsvc:Custom Field's Web Service Alias>Whatever Type of Value</bsvc:Custom Field's Web Service Alias>
</bsvc:Custom Object's Web Service Alias>
Keep in mind that the Custom Fields may be of type boolean so it could also look like this:
<bsvc:tShirtSize>
<!--If field is required send else don't-->
<bsvc:mXs>true</bsvc:mXs>
<!--If field is required send else don't-->
<bsvc:Ms>false</bsvc:Ms>
</bsvc:tShirtSize>
Hope this helps!

Filter envelopes by email docusign

I need retrieving all the envelopes that have been signed or sent to an email.
I was trying to do this using the 'accounts/{account_id}/envelopes' endpoint passing the 'search_text' query param. As in the example in documentation https://developers.docusign.com/esign-rest-api/guides/concepts/envelopes/search
/v2.1/accounts/{account_id}/envelopes?search_text=Tabs
But I'm getting always error 400 - INVALID_REQUEST_PARAMETER. Am I doing this in the wrong way?
I think 4644 is most likely not your account ID. can you check what is your account ID?
Also, add :
&from_date=2019-03-04T00:00:00.000Z&to_date=2019-03-07T00:00:00.000Z

Returning custom contact fields via the Google contacts api

I have been unable to return any UserDefined/custom fields for a contact. I'm not even wanting to create or update an existing entry as per Programatically adding "New Custom Field" To Google Contacts using Google contact API
I have followed the guide here https://developers.google.com/google-apps/contacts/v3/reference, but still to no avail.
I've called both
https://www.google.com/m8/feeds/contacts/default/full?alt=json
and
https://www.google.com/m8/feeds/contacts/default/full/DEADBEEF?alt=json
in an attempt to get ALL of the values returned. I thought I might have to call each contact id specifically to get the full details, but that doesn't work either.
DEADBEEF is clearly replaced with a valid contact id in my scenario.
/contacts/default determines that request should return contacts for the current auth'd user, which is myself in this case.
Has anyone managed to return custom values, is this even possible?
Thanks
I found the answer, add the ?v=3.0 to the url string eg
https://www.google.com/m8/feeds/contacts/default/full/DEADBEEF?alt=json&v=3.0
However, you should use the preferred method of adding a GData-Version header.

Plivo Speak doesn't work

I have created a really simple xml file for testing plivo:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Speak>Hello, Input your 4-digit pin number</Speak>
<GetDigits action="https://example.com/voice/plivo/renderVoiceCallDirective/wGather" method="POST">
<Speak>Enter your 4-digit pin number, followed by the hash key</Speak>
</GetDigits>
<Speak>Input not received. Thank you</Speak>
<Redirect>/voice/plivo/timeoutRedirect/xxx</Redirect>
</Response>
In theory, plivo will read the content of and gather the input digits
but it seems like the Speak and GetDigits doesn't work, because after getting this xml, plivo directly goes to the redirect url. The call will last several second and hangup. Any one know why this happens? Thanks
The XML is validated first before executing it. The URL given in "Redirect" tag is not a valid URL. So the XML fails the validation and the call hangs up.
Try using a valid URL in Redirect XML.

Google Contact API Fetch Contacts related to a Contact Group

I would like to know how to get all contacts related to a group.
Let's say I have a contact group named "My Special Group" and the ID is xxxxxxx.I just want to retrieve contact under the "My Special Group" only.
I have already tried this Request URI and test it on oauth2 playground:
https://www.google.com/m8/feeds/contacts/default/full/?group=xxxxxxx.
https://www.google.com/m8/feeds/contacts/myemail%40gmail.com/full/?group=xxxxxxx.
And the result is:
<errors xmlns="http://schemas.google.com/g/2005">
<error>
<domain>GData</domain>
<code>invalid</code>
<internalReason>Supposed groupUri xxxxxxxxdoes not match template</internalReason>
</error>
</errors>
What exactly the correct Request URI to retrieving contacts related to specific group?
Already walked around stackoverflow & the answer is exactly what I do above.Its failed.
Okay fellas. I found the answer.Here it is.
The supposed Request URI to retrieve contacts related to a contact group is like this:
https://www.google.com/m8/feeds/contacts/default/full?&group=http://www.google.com/m8/feeds/groups/yourmail%40gmail.com/base/xxxxxxx
where xxxxxx is the contact group id.
Before this I'm using this Request URI :
https://www.google.com/m8/feeds/contacts/default/full?&group=xxxxxxx
where xxxxxx is the contact group id and the result is will be failed because I'm just put the group id instead of use full uri of contacts group .
So that's all.Hope its help.

Resources