from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 502977261 # 4C Insights Test Account client = Client(context={'account_id': account_id}) enable_requests_logging() client.headers['X-RestLi-Protocol-Version'] = '2.0.0' params = 'ids=List(urn%3Ali%3AugcPost%3A6456174447488430082,urn%3Ali%3AugcPost%3A6452598395432505344)' response = client.get('ugcPosts?' + params) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client ACCOUNT_ID = 502977261 # 4C Insights Test Account ACCOUNT_URN = "urn:li:sponsoredAccount:" + str(ACCOUNT_ID) MEMBER_ID = "-bZaJqJQEO" # Noopur MEMBER_URN = "urn:li:person:" + MEMBER_ID client = Client(context={'account_id': ACCOUNT_ID}) enable_requests_logging() body = { "account": ACCOUNT_URN, "member": MEMBER_URN, "state": "REQUESTED", } urlString = 'adInMailMemberSenderPermissions/account=' + ACCOUNT_URN + '&member=' + MEMBER_URN response = client.put(urlString, json=body) # content = response.json() # import json # json.dumps(content)
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 502977261 # 4C Insights Test Account client = Client(context={'account_id': account_id}) enable_requests_logging() # client.headers['X-RestLi-Protocol-Version'] = '2.0.0' # response = client.get('people/id=1LGB3s99Xm') params = { 'ids': 'List((id:Fly49JJXMn),(id:1LGB3s99Xm),(id:rOCE-Baqcl))' } response = client.get('people', params=params) # response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 500735271 # VoxSup Inc client = Client(context={'account_id': account_id}) enable_requests_logging() params = { 'ids': [930516], # 'projection': '(results(*(*,subContent(*(*,adUnitV2~:playableStreams)))))', 'projection': '(results(*(*,sender(*,displayPictureV2~:playableStreams),subContent(*(*,adUnitV2~:playableStreams)))))', } response = client.get('adInMailContentsV2', params=params) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 502977261 # 4C Insights Test Account client = Client(context={'account_id': account_id}) enable_requests_logging() params = { 'q': 'viewer' } response = client.get('connections', params=params) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 500735271 # VoxSup Inc client = Client(context={'account_id': account_id}) enable_requests_logging() body = {"patch": {"$set": {"htmlBody": "Hi I'm Joe"}}} response = client.post('adInMailContentsV2/1120974', json=body) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 500735271 # VoxSup Inc client = Client(context={'account_id': account_id}) enable_requests_logging() body = { "patch": { "$set": { "htmlBody": "Hi I'm Joe" } } } response = client.post('adInMailContentsV2/1120974', json=body) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client import requests account_id = 502977261 # 4C Insights Test Account COMPANY_ID = 5021850 # 4C Insights client = Client(context={'account_id': account_id}) # enable_requests_logging() def remove_prefix(text, prefix): if text.startswith(prefix): return text[len(prefix):] return text def trimMediaAssetURN(urn): return remove_prefix(urn, 'urn:li:digitalmediaAsset:') registerParams = { 'action': 'registerUpload', } registerBody = { "registerUploadRequest": { "owner": "urn:li:company:" + str(COMPANY_ID), "serviceRelationships":[{"relationshipType":"OWNER","identifier":"urn:li:userGeneratedContent"}], "recipes": [ "urn:li:digitalmediaRecipe:ads-video" ] } } registerResponse = client.post('assets', params=registerParams, json=registerBody) content = registerResponse.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 500735271 # VoxSup Inc COMPANY_ID = 3026918 # VoxSup Inc client = Client(context={'account_id': account_id}) enable_requests_logging() params = { 'q': 'accounts', 'accounts': 'urn:li:sponsoredAccount:500735271', 'projection': '(elements*(user~))', } response = client.get('adAccountUsersV2', params=params) content = response.json() import json json.dumps(content)
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 502977261 # 4C Insights Test Account client = Client(context={'account_id': account_id}) enable_requests_logging() client.headers['X-RestLi-Protocol-Version'] = '2.0.0' serialized_targeting_criteria = '(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3Askills:List(urn%3Ali%3Askill%3A17))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3AcountryGroup%3ANA))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))))))' url = 'audienceCountsV2?q=targetingCriteriaV2&targetingCriteria={0}'.format( serialized_targeting_criteria ) response = client.get(url) response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client import requests account_id = 502977261 # 4C Insights Test Account COMPANY_ID = 5021850 # 4C Insights client = Client(context={'account_id': account_id}) # enable_requests_logging() def remove_prefix(text, prefix): if text.startswith(prefix): return text[len(prefix):] return text def trimMediaAssetURN(urn): return remove_prefix(urn, 'urn:li:digitalmediaAsset:') registerParams = { 'action': 'registerUpload', } registerBody = { "registerUploadRequest": { "owner": "urn:li:company:" + str(COMPANY_ID), "serviceRelationships": [{ "relationshipType": "OWNER", "identifier": "urn:li:userGeneratedContent" }], "recipes": ["urn:li:digitalmediaRecipe:ads-video"]
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 502977261 # 4C Insights Test Account client = Client(context={'account_id': account_id}) enable_requests_logging() # client.headers['X-RestLi-Protocol-Version'] = '2.0.0' # response = client.get('people/id=1LGB3s99Xm') params = {'ids': 'List((id:Fly49JJXMn),(id:1LGB3s99Xm),(id:rOCE-Baqcl))'} response = client.get('people', params=params) # response.json()
from voxsup.api.client.linkedin import LinkedInClient as Client account_id = 500735271 # VoxSup Inc COMPANY_ID = 3026918 # VoxSup Inc INMAIL_ID = 1225113 # Testing preview client = Client(context={'account_id': account_id}) # enable_requests_logging() def remove_prefix(text, prefix): if text.startswith(prefix): return text[len(prefix):] return text def trimMediaAssetURN(urn): return remove_prefix(urn, 'urn:li:digitalmediaAsset:') registerParams = { 'action': 'registerUpload', } registerBody = { "registerUploadRequest": { "owner": "urn:li:company:" + str(COMPANY_ID), "serviceRelationships":[{"relationshipType":"OWNER","identifier":"urn:li:userGeneratedContent"}], "recipes": [ "urn:li:digitalmediaRecipe:spinmail-banner-image" ] } } registerHeaders = { "Content-Type": "application/json" }