Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Access Values That Would Be In $Auth With Api? Rate Topic   - - - - -

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 111 posts

Posted 05 August 2020 - 08:37 AM #1

Hello, I'm trying to get the hang of customizing the mobile app of CS Cart. I have some custom code that (on the web) adds some details in $auth that are essential to something I'm doing. 

 

My question is: Is there a way to grab the what the contents of the $auth array would be in using the CS Cart API that the mobile app uses?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11852 posts

Posted 05 August 2020 - 09:50 PM #2

Auth is generally a small subset of user and profile.  it is also store in the Session which is not generally available via the API since the Session is only valid for the current transaction (other than for internal counters like number of records).

 

If your custom fields are implemented as profile fields, you should have them accessible from the Users entity of the API.  But you will have to reference them by index given they are not stored/presented as associative arrays.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 111 posts

Posted 06 August 2020 - 04:04 AM #3

Thanks, I'll keep that in mind. 

 

I also found out it's possible to extend the functionality of the API correct? And you can use the cs cart functions when extending the API to process data before sending it back to the requester? So I was thinking maybe I just extend the API and use the fn_fill_auth() function since it returns what $auth would contain at initialization and at log in and create an Entity for that can be returned when requesting from the API. Am I understanding the documentation properly that that would be possible? 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11852 posts

Posted 06 August 2020 - 08:43 PM #4

I wouldn't bother with fn_fill_auth() for an API extension.  Just grab what you need directly from the DB for your new (or extended) entity.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 111 posts

Posted 06 August 2020 - 11:59 PM #5

I see, appreciate the help!