[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Import orders from SHOPIFY



Have you tried making this request through Postman (or Insomnia or SoapUi, or ...?)

You really should because that will tell you if you have the format of the request etc. correct.

I have tried your code and while I get an error it is a different one to the one you see - I get a "406 : Not Acceptable" error.  I don't know enough about the API to attempt to diagnose that error but looking at the HTTPAPI log it seems that all of the handshaking etc. appears to be working correctly.

This makes me wordier if this might be related to the level of encryption available on the V6 release.  An awful lot of web sites - and particularly the secure sites that take payments etc - no longer accept the encryption standards available on V6.  At least I recall it being V6 that the major problems arose. Maybe others here can confirm that.

If this is the problem then running the request through a test tool like those I listed above will identify if this is the problem.  Get it working with the tool and then retry the HTTPAPI.

But if I'm right about the encryption level on V6 being the problem then as far as using HTTPAPI you are going to be out of luck on that box.




On Sep 5, 2020, at 3:22 AM, Fulvio Biagini <fulvio.biagini@xxxxxxxxx> wrote:

This is the program I tried to make using LIBHTTP:

    H dftactgrp(*no) actgrp(*new)                                               
     H bnddir('HTTPAPI') option(*srcstmt)                                        
                                                                                 
      /define WEBFORMS                                                           
      /copy httpapi_h                                                            
                                                                                 
     D addSpecialHeaders...                                                      
     D                 PR                                                        
     D   headersToAdd             32767A   varying                               
     D   vars                              likeds(headerVars) const              
                                                                                 
     D headerVars      ds                  qualified                             
     D   acceptType                 100a   varying                               
     D   apikey                     100a   varying                               
                                                                                 
     D form            s                   like(WEBFORM)                         
     D url             s           1000a   varying                               
     D msg             s           1000a   varying                               
     D errnum          s             10i 0                                       
     D rc              s             10i 0                                              
                                                                                        
      /free                                                                             
                                                                                        
       // Turn'on debugging -- probably want this to be *OFF                            
       //  when in production.                                                          
                                                                                        
       http_debug(*on);                                                                 
                                                                                        
       // Create a URL with a properly encoded query string:                            
                                                                                        
       // form = WebForm_open();                                                        
       // WebForm_setVar(form: qry);                                                    
                                                                                        
       url = '';                                                     
                                                                                        
       // WebForm_close(form);                                                          
                                                                                        
       // Tell HTTPAPI to use an "exit procedure" that is a subprocedure                
      // called when it's adding headers to the URL.  Pass the API              
      // key and content-type to accept to the exit procedure when              
      // the time comes.                                                        
                                                                                
      headerVars.acceptType = 'Content-Type';                                   
      headerVars.apiKey     = 'application/json';                               
                                                                                
      http_xproc( HTTP_POINT_ADDL_HEADER                                        
                : %paddr(addSpecialHeaders)                                     
                : %addr(headerVars) );                                          
                                                                                
      headerVars.acceptType = 'X-Shopify-Access-Token';                         
      headerVars.apiKey     = 'shppa_123456789013456790123456790';         
                                                                                
      http_xproc( HTTP_POINT_ADDL_HEADER                                        
                : %paddr(addSpecialHeaders)                                     
                : %addr(headerVars) );                                          
                                                                                
      // Perform a GET request and save the result to a file in the IFS.        
       rc = http_get( url: '/home/test/http.txt' );                                     
       if rc <> 1;                                                                      
         msg = http_error();                                                            
         http_error(errnum);                                                            
         http_crash();                                                                  
       endif;                                                                           
                                                                                        
       *inlr = *on;                                                                     
                                                                                        
      /end-free                                                                         
                                                                                        
                                                                                        
     P addSpecialHeaders...                                                             
     P                 B                                                                
     D                 PI                                                               
     D   headersToAdd             32767A   varying                                      
     D   vars                              likeds(headerVars) const                     
                                                                                        
     D CRLF            C                   x'0d25'                                      
      /free                                                                             
         headersToAdd = 'accept: ' + vars.acceptType + CRLF           
                      + 'apikey: ' + vars.apiKey + CRLF;              
      /end-free                                                       
     P                 E 

and this is the log when I try to run it:

 > call tst_http                                                              
   (GSKit) Il valore dell'identificatore non è valido.                        
   (GSKit) "Peer" non riconosciuto o è stato ricevuto un messaggio formattato 
     non correttamente.                                                       
   SSL Handshake: (GSKit) "Peer" non riconosciuto o è stato ricevuto un       
     messaggio f                                                              
   /*      */     

the Operating System installed is the V6R1M0 L00

and this is the site where there is news about Shopify

https://shopify.dev/docs/admin-api/graphql/reference
 
thank you
Fulvio   

                                                         
Il 05/09/2020 02:43, Scott Klement ha scritto:
I think he's asking for examples of calling Shopify.  (I don't have any, but others might?  Not sure what Shopify is...)

On 9/4/2020 3:12 PM, Jon Paris wrote:
It might help if you told us what problem you are experiencing.


--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi