REST API knowledge exchange
			
		
		
			
				
																			
								sirinech 							 
						Influencer 			
		Posts:  23Liked:  1 time Joined:  Mar 21, 2014 3:06 pmFull Name:  sirine chadly
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by sirinech  May 16, 2014 11:05 am 
				
			
			
			
			Hello Every Body, I'm trying to get the X-RestSession using curl php :
Code: Select all 
$ch = curl_init();
$curlConfig = array(
    CURLOPT_URL            =>     $url,
	CURLOPT_VERBOSE        => true,
	CURLOPT_HEADER         => true,
    CURLOPT_POST           =>  true,
    CURLOPT_RETURNTRANSFER => true,
    
);
curl_setopt_array($ch, $curlConfig);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_HTTPHEADER,
            array(
			'HTTP_AUTH_LOGIN: '.$login,
            'HTTP_AUTH_PASSWD: '.$passwd, 
            'Content-Type: application/xml; charset=utf-8',
            'Content-Length: '.strlen($data),
            'Authorization: Basic '.$data,
));
 
curl_exec($ch);
 But I get this screen:
https://www.dropbox.com/s/mkgtbnwvg3lix75/test.png 
What could be the problem??
 
		 
				
		
		 
	 
				
		
		
			
				
																			
								sirinech 							 
						Influencer 			
		Posts:  23Liked:  1 time Joined:  Mar 21, 2014 3:06 pmFull Name:  sirine chadly
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by sirinech  May 17, 2014 8:08 pm 
				
			
			
			
			I changed the code to this and it worked but I don't see the X-RestSvcSessionId in the response header how do I get it?
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								sirinech 							 
						Influencer 			
		Posts:  23Liked:  1 time Joined:  Mar 21, 2014 3:06 pmFull Name:  sirine chadly
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by sirinech  May 17, 2014 9:30 pm 
				1 person likes  this post
			
			
			
			Solved
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								clh_jl 							 
						Service Provider 			
		Posts:  14Liked:  2 times Joined:  Sep 22, 2014 12:49 pm
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by clh_jl  Sep 22, 2014 12:50 pm 
				
			
			
			
			What was the solution?
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								veremin 							 
						Product Manager 			
		Posts:  20736Liked:  2403 times Joined:  Oct 26, 2012 3:28 pmFull Name:  Vladimir Eremin
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by veremin  Sep 22, 2014 2:42 pm 
				
			
			
			
			Are experiencing any problems while trying to create logon session via cURL? The following request should work fine, at least it does so in my case (I'm using Windows cURL client):
Code: Select all 
curl -XPOST -v -u user:password http://EM:9399/api/sessionMngr/ -H "Content-Length: 0"
Thanks.
 
		 
				
		
		 
	 
				
		
		
			
				
																			
								clh_jl 							 
						Service Provider 			
		Posts:  14Liked:  2 times Joined:  Sep 22, 2014 12:49 pm
				Contact: 
				
			 
				
		 
		
						
					
																		
							
						
									
						Post 
					 
								by clh_jl  Sep 24, 2014 2:40 pm 
				
			
			
			
			Hi,
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								veremin 							 
						Product Manager 			
		Posts:  20736Liked:  2403 times Joined:  Oct 26, 2012 3:28 pmFull Name:  Vladimir Eremin
				Contact: 
				
			 
				
		 
		
						
					
																			
						
									
						Post 
					 
								by veremin  Sep 24, 2014 4:19 pm 
				
			
			
			
			Glad to hear you've nailed. Don't forget to utilize our 
Help Center  to learn more about syntax and available entities. Thanks.
 
		 
				
		
		 
	 
	
	
	
		
		Users browsing this forum: No registered users and 1 guest