I'm trying to send 'POST' web request to specific address (for example: https://qa.alycedev.com/)
Any properties set (header, body, cookies, url encode/decode) leads to error while sending my web request:
Warning > Cannot send the test request. Reason:
java.lang.IllegalArgumentException: invalid start or end.
Below you can find details of error:
https://i.stack.imgur.com/szGan.png
Example of my request:
#Keyword
def purchase_simple (def totalCookies) {
WebUI.comment('Total number of cookies=' +totalCookies.size())
RequestObject ro = new RequestObject('A')
ro.setRestRequestMethod('POST')
ro.setRestUrl('https://qa.alycedev.com/gifter/dashboard')
def httpheader = new ArrayList<TestObjectProperty>()
httpheader.add(new TestObjectProperty('Content-Type', ConditionType.EQUALS, 'application/json'))
httpheader.add(new TestObjectProperty('Accept', ConditionType.EQUALS, 'application/json'))
for (Cookie currentCookie : totalCookies) {
httpheader.add(new TestObjectProperty('Cookie', ConditionType.EQUALS, 'domain='+currentCookie.getDomain() + '; '+currentCookie.getName() + '=' + currentCookie.getValue() + '; expires='+currentCookie.getExpiry() + '; Max-Age=7200; path=/;'))
}
ro.setHttpHeaderProperties(httpheader)
def body = '{"_token": "' + GlobalVariable.G_api_oauth.csrfToken + '","use_credits": ' + GlobalVariable.G_product.price + ',"use_payment": 0.00,"currency_id": 1,"total_price": ' + GlobalVariable.G_product.price + ',"payment_data" : null,"gift_send_data": "{"id":' + GlobalVariable.G_gift.id + ',"product_id":' + GlobalVariable.G_product.id + ',"total_price":' + GlobalVariable.G_product.price + ',"send_now":true,"schedule_at":"","send_type":"hwcard","gifter_company":"Apple","giftee_company":"Sony","from":null,"gifter_address":{"country":{"id":1,"name":"United States","code":"US","image":""},"country_id":1,"address":"Address","address2":"Address 2","city":"City","state":"State","zipcode":"123321"},"giftee_address":{"country":{"id":1,"name":"United States","code":"US","image":""},"country_id":1,"address":"Address","address2":"Address 2","city":"City","state":"State","zipcode":"123321"},"message_to_giftee":{"id":1,"default":1,"message":"Messages subject + 10 characters.","subject":"Something for your time","name":"Something for your time"},"prospect":{"capture_date":true,"capture_email":true,"capture_phone":true,"capture_question":false,"capture_affidavit":false,"gifter_affidavit":"","gifter_question":""},"delivery_method_data":{"type":"branded_box"}}"}'
ro.setBodyContent(new HttpTextBodyContent(body, 'UTF-8', 'application/json'))
WebUI.comment(ro.activeProperties.toArray().toString())
try{
def response = WSBuiltInKeywords.sendRequest(ro)
}
catch(Exception ex) {
println(ex.detailMessage)
println(ex.stackTraceDepth.toString())
}
}
I am writting an C# app to make use of Linkedin's API.
I want to be able to query "Person" (First Name + Last Name) and retrieve all the possible information about this group of people with the same name
I am currently using my own implementation of the REST API alongside People-Search API calls.
Here's an example of a request that I know works:
https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,picture-url),num-results)?
I'm running it with: first-name=parameter&last-name=parameter after the ? mark
The problem is, I want to retrieve more information such as Title, Industry, Current-company, current-school etc. Refer here for the list of possible parameters.
This notation is what they call Field Selectors
How do i structure my API Call so i can get all the possible information about someone ?
Here is the url to get everything for a user Profile:
https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,picture-url,industry,summary,specialties,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes),associations,interests,num-recommenders,date-of-birth,publications:(id,title,publisher:(name),authors:(id,name),date,url,summary),patents:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url),languages:(id,language:(name),proficiency:(level,name)),skills:(id,skill:(name)),certifications:(id,name,authority:(name),number,start-date,end-date),courses:(id,name,number),recommendations-received:(id,recommendation-type,recommendation-text,recommender),honors-awards,three-current-positions,three-past-positions,volunteer)?oauth2_access_token=PUT_YOUR_TOKEN_HERE
Requires an Oauth2 access token.
Here it is in a nice String list (Java):
apiUrl
+ "/v1/people/~:("
+ "id,"
+ "first-name,"
+ "last-name,"
+ "headline,"
+ "picture-url,"
+ "industry,"
+ "summary,"
+ "specialties,"
+ "positions:("
+ "id,"
+ "title,"
+ "summary,"
+ "start-date,"
+ "end-date,"
+ "is-current,"
+ "company:("
+ "id,"
+ "name,"
+ "type,"
+ "size,"
+ "industry,"
+ "ticker)"
+"),"
+ "educations:("
+ "id,"
+ "school-name,"
+ "field-of-study,"
+ "start-date,"
+ "end-date,"
+ "degree,"
+ "activities,"
+ "notes),"
+ "associations," /* Full Profile */
+ "interests,"
+ "num-recommenders,"
+ "date-of-birth,"
+ "publications:("
+ "id,"
+ "title,"
+ "publisher:(name),"
+ "authors:(id,name),"
+ "date,"
+ "url,"
+ "summary),"
+ "patents:("
+ "id,"
+ "title,"
+ "summary,"
+ "number,"
+ "status:(id,name),"
+ "office:(name),"
+ "inventors:(id,name),"
+ "date,"
+ "url),"
+ "languages:("
+ "id,"
+ "language:(name),"
+ "proficiency:(level,name)),"
+ "skills:("
+ "id,"
+ "skill:(name)),"
+ "certifications:("
+ "id,"
+ "name,"
+ "authority:(name),"
+ "number,"
+ "start-date,"
+ "end-date),"
+ "courses:("
+ "id,"
+ "name,"
+ "number),"
+ "recommendations-received:("
+ "id,"
+ "recommendation-type,"
+ "recommendation-text,"
+ "recommender),"
+ "honors-awards,"
+ "three-current-positions,"
+ "three-past-positions,"
+ "volunteer"
+ ")"
+ "?oauth2_access_token="+ token;
You've already got the notation down, all you need to do is add the rest of the field selectors, nesting them where needed:
https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,picture-url,industry,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)),num-results)?first-name=parameter&last-name=parameter
Keep in mind that per the Profile Field docs, you can only get educations for 1st degree connections of the current user.
I use this URL to get everything including email and formatted as json:
https://api.linkedin.com/v1/people/~:(id,first-name,email-address,last-name,headline,picture-url,industry,summary,specialties,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes),associations,interests,num-recommenders,date-of-birth,publications:(id,title,publisher:(name),authors:(id,name),date,url,summary),patents:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url),languages:(id,language:(name),proficiency:(level,name)),skills:(id,skill:(name)),certifications:(id,name,authority:(name),number,start-date,end-date),courses:(id,name,number),recommendations-received:(id,recommendation-type,recommendation-text,recommender),honors-awards,three-current-positions,three-past-positions,volunteer)?format=json