Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Sending insights - 403 Forbidden error

connection
errors
http_errors
insights
insightsapi

#1

I’m going to collect some data from Magento 2 platform in NR Insights for that I’m trying to insert some events with data into NR Insights. However, I could not see them after sending. After some investigation, I understood that I get 403 Forbidden error constantly.

I have tried to run the same request that is mentioned on Insert Key generation page:

gzip -c e.json | curl --data-binary @- -X POST -H "Content-Type: application/json" -H "X-Insert-Key: RhwXXXXXXXXXXXXXXXXXXXXXXX0h" -H "Content-Encoding: gzip" -w "%{http_code}" https://insights-collector.eu01.nr-data.net/v1/accounts/13XXXX3/events

FIle e.json contains such JSON info:

{"eventType":"Cron","appName":"PROJ 2502","appId":52XXXX7,"productCatalogSize":44094433,"productCatalogConfigurableSize":0,"productCatalogActiveSize":49330802,"CatalogCategoryCount":43121,"WebsiteCount":1,"StoreViewCount":1,"CustomerCount":5812507}

Also, I have tried to sent this request via Postman app - the same results.

And tried to send this request from different account (with payed subscription) - the same issue.

I could not make it anyway.

Can someone please help me to get it worked?

Thanks!


#2

Hi, @r.glushko: You must have an Insights Pro subscription in order to send custom events to Insights. Also, your example is sending a header called X-InKey, which is incorrect; it must be X-Insert-Key.

The following command works for me (I am in U.S., so posting to a different collector):

gzip -c e.json | curl --data-binary @- -X POST \
  -H "Content-Type: application/json" \
  -H "X-Insert-Key: {my-insert-key}" \
  -H "Content-Encoding: gzip" \
  https://insights-collector.newrelic.com/v1/accounts/{my-account-id}/events

#3

Hi, @philweber: For some reasons insert key header was copied with that typo. I have checked my bash history and I see that I used right name for the header. Also, I have trial on one of my accounts for Insight Pro feature, so should it work till it expires? If so, I could not get it worked.

How can I troubleshoot this?

Thank you!


#4

I don’t think it will work with a trial. It has to be a paid subscription.


#6

@philweber Is Insight Pro a separated product or it’s included to existing plans?


#7

Insights Pro is a separate subscription. If you subscribe to another New Relic product (APM, Browser, Infrastructure, Mobile, or Synthetics), you get a certain amount of Insights data at no additional charge. In order to store more data, or to access features like custom events, you must purchase a separate subscription to Insights Pro.